public class BcBcryptEncoder extends AbstractBcryptPasswordEncoder
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_VERSION
The default version '2b', if no value is specified.
|
static String |
KEY_VERSION
Property key for the version to use, 2a, 2y, or 2b.
|
static String |
VERSION_2A
The '2a' version.
|
static String |
VERSION_2B
The '2b' version.
|
static String |
VERSION_2Y
The '2y' version.
|
DEFAULT_STRENGTH, KEY_STRENGTHKEY_PREFIX, KEY_RANDOM| Constructor and Description |
|---|
BcBcryptEncoder() |
| 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_VERSION
public static final String VERSION_2A
public static final String VERSION_2Y
public static final String VERSION_2B
public static final String DEFAULT_VERSION
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