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)
PasswordEncoder
encode
in interface PasswordEncoder
public boolean matches(CharSequence rawPassword, String encodedPassword)
PasswordEncoder
matches
in interface PasswordEncoder
rawPassword
- 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)