PasswordEncoder
@Deprecated public abstract class BasePasswordEncoder extends java.lang.Object implements PasswordEncoder
Convenience base for all password encoders.
Constructor and Description |
---|
BasePasswordEncoder()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String[] |
demergePasswordAndSalt(java.lang.String mergedPasswordSalt)
Deprecated.
Used by subclasses to extract the password and salt from a merged
String created using
mergePasswordAndSalt(String,Object,boolean) . |
protected java.lang.String |
mergePasswordAndSalt(java.lang.String password,
java.lang.Object salt,
boolean strict)
Deprecated.
Used by subclasses to generate a merged password and salt
String . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
encodePassword, isPasswordValid
protected java.lang.String[] demergePasswordAndSalt(java.lang.String mergedPasswordSalt)
String
created using
mergePasswordAndSalt(String,Object,boolean)
.
The first element in the returned array is the password. The second element is the
salt. The salt array element will always be present, even if no salt was found in
the mergedPasswordSalt
argument.
mergedPasswordSalt
- as generated by mergePasswordAndSalt
java.lang.IllegalArgumentException
- if mergedPasswordSalt is null or empty.protected java.lang.String mergePasswordAndSalt(java.lang.String password, java.lang.Object salt, boolean strict)
String
.
The generated password will be in the form of password{salt}
.
A null
can be passed to either method, and will be handled correctly.
If the salt
is null
or empty, the resulting generated
password will simply be the passed password
. The toString
method of the salt
will be used to represent the salt.
password
- the password to be used (can be null
)salt
- the salt to be used (can be null
)strict
- ensures salt doesn't contain the delimitersString
java.lang.IllegalArgumentException
- if the salt contains '{' or '}' characters.