public class Pbkdf2Encoder extends AbstractPbkdf2PasswordEncoder
| Modifier and Type | Field and Description |
|---|---|
static String |
ALGORITHM_PBKDF2_HMAC_GOST
The PBKDF2withHmacGOST3411 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA1
The PBKDF2withHmacSHA1 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA224
The PBKDF2withHmacSHA224 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA256
The PBKDF2withHmacSHA256 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA3_224
The PBKDF2withHmacSHA3-224 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA3_256
The PBKDF2withHmacSHA3-256 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA3_384
The PBKDF2withHmacSHA3-384 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA3_512
The PBKDF2withHmacSHA3-512 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA384
The PBKDF2withHmacSHA384 algorithm.
|
static String |
ALGORITHM_PBKDF2_HMAC_SHA512
The PBKDF2withHmacSHA512 algorithm.
|
static String |
DEFAULT_ALGORITHM
The default algorithm value (PBKDF2withHmacSHA1 or PBKDF2withHmacSHA512 [JRE >= 1.8]), if no value is specified.
|
static int |
DEFAULT_SALT_LENGTH
The default salt length in bits if no value is specified.
|
static String |
KEY_PROVIDER_CLASS
Property key for the JCE provider class to be used to load the algorithm.
|
static String |
KEY_PROVIDER_NAME
Property key for the JCE provider name to be used to load the algorithm.
|
static String |
KEY_SALT_LENGTH
Property key for the salt length in bits.
|
DEFAULT_HASH_LENGTH, DEFAULT_ITERATIONS, KEY_ALGORITHM, KEY_HASH_LENGTH, KEY_ITERATIONS, KEY_SECRETKEY_PREFIX, KEY_RANDOM| Constructor and Description |
|---|
Pbkdf2Encoder() |
| Modifier and Type | Method and Description |
|---|---|
void |
doConfigure(Properties parameters,
String prefix)
Configures and initializes the encoder using the given Properties.
|
String |
doEncode(CharSequence rawPassword)
Encode the raw password.
|
boolean |
isMatch(CharSequence rawPassword,
String encodedPassword)
Verify the encoded password obtained from storage matches the submitted raw password after it too is encoded.
|
configure, decodeBytes, encode, encodeBytes, getCharset, getPropertyName, getRandom, getTextEncoder, matches, parseBoolean, parseInstance, parseInt, parseInt, parseString, toBytespublic static final String KEY_SALT_LENGTH
public static final String KEY_PROVIDER_NAME
public static final String KEY_PROVIDER_CLASS
public static final String ALGORITHM_PBKDF2_HMAC_SHA1
public static final String ALGORITHM_PBKDF2_HMAC_SHA224
public static final String ALGORITHM_PBKDF2_HMAC_SHA256
public static final String ALGORITHM_PBKDF2_HMAC_SHA384
public static final String ALGORITHM_PBKDF2_HMAC_SHA512
public static final String ALGORITHM_PBKDF2_HMAC_SHA3_224
public static final String ALGORITHM_PBKDF2_HMAC_SHA3_256
public static final String ALGORITHM_PBKDF2_HMAC_SHA3_384
public static final String ALGORITHM_PBKDF2_HMAC_SHA3_512
public static final String ALGORITHM_PBKDF2_HMAC_GOST
public static final String DEFAULT_ALGORITHM
public static final int DEFAULT_SALT_LENGTH
public void doConfigure(Properties parameters, String prefix)
doConfigure in class AbstractConfigurablePasswordEncoderparameters - the parametersprefix - the prefixpublic String doEncode(CharSequence rawPassword)
doEncode in class AbstractConfigurablePasswordEncoderrawPassword - the raw password to encodepublic boolean isMatch(CharSequence rawPassword, String encodedPassword)
isMatch in class AbstractConfigurablePasswordEncoderrawPassword - the raw password to encode and matchencodedPassword - the encoded password from storage to compare with