DelegatingPasswordEncoder
which supports
password upgrades. There are no plans to remove this support. It is deprecated to indicate
that this is a legacy implementation and using it is considered insecure.@Deprecated public class LdapShaPasswordEncoder extends Object implements PasswordEncoder
PasswordEncoder
is provided for legacy purposes only and is not considered
secure.
A version of PasswordEncoder
which supports Ldap SHA and SSHA (salted-SHA)
encodings. The values are base-64 encoded and have the label "{SHA}" (or "{SSHA}")
prepended to the encoded hash. These can be made lower-case in the encoded password, if
required, by setting the forceLowerCasePrefix property to true.
Also supports plain text passwords, so can safely be used in cases when both encoded
and non-encoded passwords are in use or when a null implementation is required.Constructor and Description |
---|
LdapShaPasswordEncoder()
Deprecated.
|
LdapShaPasswordEncoder(BytesKeyGenerator saltGenerator)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
String |
encode(CharSequence rawPass)
Deprecated.
Calculates the hash of password (and salt bytes, if supplied) and returns a base64
encoded concatenation of the hash and salt, prefixed with {SHA} (or {SSHA} if salt
was used).
|
boolean |
matches(CharSequence rawPassword,
String encodedPassword)
Deprecated.
Checks the validity of an unencoded password against an encoded one in the form
"{SSHA}sQuQF8vj8Eg2Y1hPdh3bkQhCKQBgjhQI".
|
void |
setForceLowerCasePrefix(boolean forceLowerCasePrefix)
Deprecated.
|
public LdapShaPasswordEncoder()
public LdapShaPasswordEncoder(BytesKeyGenerator saltGenerator)
public String encode(CharSequence rawPass)
encode
in interface PasswordEncoder
rawPass
- the password to be encoded.public boolean matches(CharSequence rawPassword, String encodedPassword)
matches
in interface PasswordEncoder
rawPassword
- unencoded password to be verified.encodedPassword
- the actual SSHA or SHA encoded passwordpublic void setForceLowerCasePrefix(boolean forceLowerCasePrefix)