Interface PasswordEncryptor
-
- All Known Implementing Classes:
Sha512HashDigest
,ShaHashDigest
public interface PasswordEncryptor
ThePasswordEncryptor
provides the api to customize the encryption of passwords.- Author:
- Daniel Meyer, nico.rehwaldt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
check(String password, String encrypted)
Returns true if the given plain text equals to the encrypted password.String
encrypt(String password)
Encrypt the given passwordString
hashAlgorithmName()
In order to distinguish which algorithm was used to hash the password, it needs a unique id.
-
-
-
Method Detail
-
check
boolean check(String password, String encrypted)
Returns true if the given plain text equals to the encrypted password.- Parameters:
password
-encrypted
-- Returns:
-
hashAlgorithmName
String hashAlgorithmName()
In order to distinguish which algorithm was used to hash the password, it needs a unique id. In particular, this is needed forcheck(java.lang.String, java.lang.String)
.- Returns:
- the name of the algorithm
-
-