Interface IPasswordHashCreator
-
- All Known Implementing Classes:
AbstractPasswordHashCreator,AbstractPasswordHashCreatorPBKDF2,PasswordHashCreatorBCrypt,PasswordHashCreatorPBKDF2_SHA256_1000_48,PasswordHashCreatorSHA512
public interface IPasswordHashCreatorInterface for a password hash creator.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringcreatePasswordHash(IPasswordSalt aSalt, String sPlainTextPassword)The method to create a message digest hash from a password.StringgetAlgorithmName()booleanrequiresSalt()
-
-
-
Method Detail
-
getAlgorithmName
@Nonnull @Nonempty String getAlgorithmName()
- Returns:
- The name of the algorithm used in this creator. May neither be
nullnor empty. This is a self-chosen name and not related to a JDK internal name.
-
requiresSalt
boolean requiresSalt()
- Returns:
trueif this hash creator requires a salt,falseif not.
-
createPasswordHash
@Nonnull String createPasswordHash(IPasswordSalt aSalt, @Nonnull String sPlainTextPassword)
The method to create a message digest hash from a password.- Parameters:
aSalt- Optional salt to be used. This parameter is onlynullfor backwards compatibility reasons.sPlainTextPassword- Plain text password. May not benull.- Returns:
- The String representation of the password hash. Must be valid to encode in UTF-8.
-
-