public abstract class AbstractPasswordEncoder extends Object implements PasswordEncoder
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPasswordEncoder() |
| Modifier and Type | Method and Description |
|---|---|
String |
encode(CharSequence rawPassword)
Encode the raw password.
|
protected abstract byte[] |
encode(CharSequence rawPassword,
byte[] salt) |
protected byte[] |
encodeAndConcatenate(CharSequence rawPassword,
byte[] salt) |
protected static boolean |
matches(byte[] expected,
byte[] actual)
Constant time comparison to prevent against timing attacks.
|
boolean |
matches(CharSequence rawPassword,
String encodedPassword)
Verify the encoded password obtained from storage matches the submitted raw
password after it too is encoded.
|
public String encode(CharSequence rawPassword)
PasswordEncoderencode in interface PasswordEncoderpublic boolean matches(CharSequence rawPassword, String encodedPassword)
PasswordEncodermatches in interface PasswordEncoderrawPassword - the raw password to encode and matchencodedPassword - the encoded password from storage to compare withprotected abstract byte[] encode(CharSequence rawPassword, byte[] salt)
protected byte[] encodeAndConcatenate(CharSequence rawPassword, byte[] salt)
protected static boolean matches(byte[] expected,
byte[] actual)