public abstract class AbstractPasswordEncoder extends java.lang.Object implements PasswordEncoder
Modifier | Constructor and Description |
---|---|
protected |
AbstractPasswordEncoder() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
encode(java.lang.CharSequence rawPassword)
Encode the raw password.
|
protected abstract byte[] |
encode(java.lang.CharSequence rawPassword,
byte[] salt) |
protected byte[] |
encodeAndConcatenate(java.lang.CharSequence rawPassword,
byte[] salt) |
protected static boolean |
matches(byte[] expected,
byte[] actual)
Constant time comparison to prevent against timing attacks.
|
boolean |
matches(java.lang.CharSequence rawPassword,
java.lang.String encodedPassword)
Verify the encoded password obtained from storage matches the submitted raw
password after it too is encoded.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
upgradeEncoding
public java.lang.String encode(java.lang.CharSequence rawPassword)
PasswordEncoder
encode
in interface PasswordEncoder
public boolean matches(java.lang.CharSequence rawPassword, java.lang.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(java.lang.CharSequence rawPassword, byte[] salt)
protected byte[] encodeAndConcatenate(java.lang.CharSequence rawPassword, byte[] salt)
protected static boolean matches(byte[] expected, byte[] actual)