Class GenericSaltedPasswordEncoder
java.lang.Object
de.hybris.platform.persistence.security.GenericSaltedPasswordEncoder
- All Implemented Interfaces:
PasswordEncoder,Serializable
Generic password encoder that can be parametrized with
SaltEncodingPolicy
and digest algorithm name. Algorithm name must be supported by MessageDigest- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCalculates the hash of 'plain' and compare it with the value of 'encoded'.final StringDecode the givenencodedpassword.This method add salt to the password and then calculates digestvoidsetAlgorithm(String algorithm) SetsMessageDigestalgorithm used by this beanvoidsetSaltEncodingPolicy(SaltEncodingPolicy saltEncodingPolicy)
-
Constructor Details
-
GenericSaltedPasswordEncoder
public GenericSaltedPasswordEncoder()
-
-
Method Details
-
encode
This method add salt to the password and then calculates digest- Specified by:
encodein interfacePasswordEncoder- Parameters:
uid- the user idpassword- the user password- Returns:
- the hashed value of the salted password
- See Also:
-
check
Calculates the hash of 'plain' and compare it with the value of 'encoded'.- Specified by:
checkin interfacePasswordEncoder- Parameters:
uid- the user idencoded- could be 'null'password- could be 'null'- Returns:
- true if hash of 'plain' is equals to 'encoded'
- See Also:
-
decode
Description copied from interface:PasswordEncoderDecode the givenencodedpassword. Throws exception if this is not possible.- Specified by:
decodein interfacePasswordEncoder- Parameters:
encoded- the encoded password- Returns:
- the decoded password
- Throws:
EJBCannotDecodePasswordException- if the password cannot be decoded. (MD5 passwords cannot be decoded)- See Also:
-
getAlgorithm
-
setAlgorithm
SetsMessageDigestalgorithm used by this bean- Parameters:
algorithm- message digest algorithm
-
setSaltEncodingPolicy
-