public interface PasswordHashFunction
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(String passwordHash)
Test whether the provided hash was generated by
generate(String) of this hash
function. |
boolean |
check(String passwordHash,
String password)
Test a clear text password against a password hash generated by this hash function.
|
String |
generate(String password)
Generate the hash of a clear text password.
|
String |
getIdentifier() |
boolean |
needsUpdate(String passwordHash)
Test whether a password hash needs to be updated.
|
boolean canHandle(String passwordHash)
generate(String)
of this hash
function.passwordHash
- a password hashboolean check(String passwordHash, String password)
canHandle(String)
for the hash returns true.passwordHash
- a hash generated by this functionpassword
- the clear text password to validateString generate(String password)
canHandle(String)
) and to check the hash against a clear-text
password in check(String, String)
. The latter requires to include the salt
and any parameters like cost factors or iterations in the created string. A recommended way
to encode this information is the
PHC string
format.password
- the clear text password to hashString getIdentifier()
boolean needsUpdate(String passwordHash)
generate(String)
. This method will only be called if
canHandle(String)
for the hash returns true.passwordHash
- a hash generated by this functionCopyright © 2019 Communote team. All rights reserved.