public final class HashedPassword extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SCHEME_CLEARTEXT |
static String |
SCHEME_MD5 |
static String |
SCHEME_SHA |
static String |
SCHEME_SHA256 |
static String |
SCHEME_SHA384 |
static String |
SCHEME_SHA512 |
Modifier and Type | Method and Description |
---|---|
String |
encode()
encodes the state as {<'S' if salted><SCHEME>}<BASE64 of
HASH>
|
boolean |
equals(Object obj) |
static HashedPassword |
fromPassword(char[] password,
String scheme)
creates hashed and salted passwords.
|
static HashedPassword |
fromPassword(char[] password,
String scheme,
byte[] salt)
Creates a hashed and salted password based on the input parameters.
|
static HashedPassword |
fromString(String encodedString)
Parses encoded hashed passwords.
|
byte[] |
getHash()
the hashed and (optional salted) password.
|
byte[] |
getSalt() |
String |
getScheme() |
int |
hashCode() |
boolean |
isSalted() |
static boolean |
isSupportedScheme(String scheme)
Tests if a scheme name is known and supported.
|
static String |
normalizeScheme(String scheme)
Normalizes a scheme name into a formal spelling.
|
String |
toString() |
public static final String SCHEME_CLEARTEXT
public static final String SCHEME_MD5
public static final String SCHEME_SHA
public static final String SCHEME_SHA256
public static final String SCHEME_SHA384
public static final String SCHEME_SHA512
public boolean isSalted()
public String getScheme()
public byte[] getSalt()
public byte[] getHash()
public String encode()
public static String normalizeScheme(String scheme)
public static boolean isSupportedScheme(String scheme)
public static HashedPassword fromString(String encodedString)
public static HashedPassword fromPassword(char[] password, String scheme)
public static HashedPassword fromPassword(char[] password, String scheme, byte[] salt)
Copyright © 2004–2018 52north.org. All rights reserved.