public class GenericSaltedPasswordEncoder extends java.lang.Object implements PasswordEncoder
SaltEncodingPolicy
and digest algorithm name. Algorithm name must be supported by MessageDigest| Constructor and Description |
|---|
GenericSaltedPasswordEncoder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(java.lang.String uid,
java.lang.String encoded,
java.lang.String password)
Calculates the hash of 'plain' and compare it with the value of 'encoded'.
|
java.lang.String |
decode(java.lang.String encoded)
Decode the given
encoded password. |
java.lang.String |
encode(java.lang.String uid,
java.lang.String password)
This method add salt to the password and then calculates digest
|
java.lang.String |
getAlgorithm() |
void |
setAlgorithm(java.lang.String algorithm)
Sets
MessageDigest algorithm used by this bean |
void |
setSaltEncodingPolicy(SaltEncodingPolicy saltEncodingPolicy) |
public java.lang.String encode(java.lang.String uid,
java.lang.String password)
encode in interface PasswordEncoderuid - the user idpassword - the user passwordSaltedMD5PasswordEncoder,
PlainTextPasswordEncoderpublic boolean check(java.lang.String uid,
java.lang.String encoded,
java.lang.String password)
check in interface PasswordEncoderuid - the user idencoded - could be 'null'password - could be 'null'MD5PasswordEncoderpublic final java.lang.String decode(java.lang.String encoded)
throws EJBCannotDecodePasswordException
PasswordEncoderencoded password. Throws exception if this is not possible.decode in interface PasswordEncoderencoded - the encoded passwordEJBCannotDecodePasswordException - if the password cannot be decoded. (MD5 passwords cannot be decoded)MD5PasswordEncoderpublic java.lang.String getAlgorithm()
public void setAlgorithm(java.lang.String algorithm)
MessageDigest algorithm used by this beanalgorithm - message digest algorithmpublic void setSaltEncodingPolicy(SaltEncodingPolicy saltEncodingPolicy)
Copyright © 2018 SAP SE. All Rights Reserved.