public interface PasswordAlgorithm
For a given String password
, we have the invariant
verifyPassword(password, hashPassword(password)) == true
.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
hashPassword(java.lang.String password)
Hashes the given password using the algorithm represented by this class.
|
boolean |
verifyPassword(java.lang.String plainTextPassword,
java.lang.String hashedPassword)
Checks if the given hashed password is the image of the given plain
text password by the method
hashPassword(String) . |
java.lang.String hashPassword(java.lang.String password)
password
- the plain text password to hashboolean verifyPassword(java.lang.String plainTextPassword, java.lang.String hashedPassword)
hashPassword(String)
.plainTextPassword
- the plain text password to check validity ofhashedPassword
- the hashed password to check plain text password againsthashPassword(String)
method