Class NoSaltedHashService
java.lang.Object
org.exoplatform.web.security.hash.NoSaltedHashService
- All Implemented Interfaces:
SaltedHashService
A
SaltedHashService implementation which does not do any hashing at all. It simply returns the plaintext password
from getSaltedHash(String) and tests the string equality of password and saltedHash in
validate(String, String).
This class is intended to be used in tests and maybe also in some real life scenarios where backwards compatibility requires
storing of plaintext passwords.- Author:
- Peter Palaga
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
NoSaltedHashService
public NoSaltedHashService()
-
-
Method Details
-
getSaltedHash
Description copied from interface:SaltedHashServiceComputes a salted hash of given plaintext password suitable for storing in a database.- Specified by:
getSaltedHashin interfaceSaltedHashService- Throws:
SaltedHashException
-
validate
Description copied from interface:SaltedHashServiceChecks whether given plaintextpasswordcorresponds to the givensaltedHash.- Specified by:
validatein interfaceSaltedHashService- Parameters:
password-saltedHash-- Returns:
trueif the givenpasswordmatches the givensaltedHash;falseotherwise.- Throws:
SaltedHashException- if thesaltedHashcannot be parsed or if the hashing algorithm is not available.
-