Class SaltedPasswordEncoder
java.lang.Object
de.hybris.platform.persistence.security.SaltedPasswordEncoder
- All Implemented Interfaces:
PasswordEncoder,Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcalculateHash(String plain) booleanChecks if theencodedpassword (from the user, from the database) and theplainpassword (from the login screen) matches.Decode the givenencodedpassword.This implementation will build a string with the following pattern
:: ::
The value for SYSTEM_SPECIFC_SALT will be generated bygetSystemSpecificSalt()
The Value for USER_SPECIFIC_SALT will be generated bygenerateUserSpecificSalt(String)
...protected StringThis implementation will still return the assigned user id.getSalt()Returns the configured SALT (see core-spring-xml).protected StringThis implementation will still return the value of the corresponding spring propertyvoidsetAlgorithmn(String algorithmn) void
-
Constructor Details
-
SaltedPasswordEncoder
public SaltedPasswordEncoder()
-
-
Method Details
-
calculateHash
-
encode
This implementation will build a string with the following pattern
:: ::
The value for SYSTEM_SPECIFC_SALT will be generated bygetSystemSpecificSalt()
The Value for USER_SPECIFIC_SALT will be generated bygenerateUserSpecificSalt(String)
... and will return the hash of this constructed string.- Specified by:
encodein interfacePasswordEncoder- Parameters:
uid- the user idpassword- the user password- Returns:
- the hashed value of the constructed string expression
- See Also:
-
check
Description copied from interface:PasswordEncoderChecks if theencodedpassword (from the user, from the database) and theplainpassword (from the login screen) matches.- Specified by:
checkin interfacePasswordEncoder- Parameters:
uid- mostly the user ID and mostly not used. For MD5 used as salt.encoded- the encoded passwordplain- the plain text password- Returns:
trueif they match,falseotherwise.- 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:
-
generateUserSpecificSalt
This implementation will still return the assigned user id.- Parameters:
uid- the suer id- Returns:
- uid the user id as assigned
-
getSystemSpecificSalt
This implementation will still return the value of the corresponding spring property- Returns:
- systemSpecificSalt the value of the corresponding spring property
-
getSalt
Returns the configured SALT (see core-spring-xml).- Returns:
- the configured SALT
-
setSalt
-
getAlgorithmn
- Returns:
- the algorithmn
-
setAlgorithmn
- Parameters:
algorithmn- the algorithmn to set
-