Class PasswordHashCreatorSHA512
- java.lang.Object
-
- com.helger.security.password.hash.AbstractPasswordHashCreator
-
- com.helger.security.password.hash.PasswordHashCreatorSHA512
-
- All Implemented Interfaces:
IPasswordHashCreator
public final class PasswordHashCreatorSHA512 extends AbstractPasswordHashCreator
The default implementation ofIPasswordHashCreatorusing unsalted SHA512 hashes.- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static StringALGORITHMstatic EMessageDigestAlgorithmUSER_PASSWORD_ALGOHashing algorithm to use for user passwords - never change it!
-
Constructor Summary
Constructors Constructor Description PasswordHashCreatorSHA512()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreatePasswordHash(IPasswordSalt aSalt, String sPlainTextPassword)The method to create a message digest hash from a password.booleanrequiresSalt()-
Methods inherited from class com.helger.security.password.hash.AbstractPasswordHashCreator
getAlgorithmName, toString
-
-
-
-
Field Detail
-
ALGORITHM
public static final String ALGORITHM
- See Also:
- Constant Field Values
-
USER_PASSWORD_ALGO
public static final EMessageDigestAlgorithm USER_PASSWORD_ALGO
Hashing algorithm to use for user passwords - never change it!
-
-
Method Detail
-
requiresSalt
public boolean requiresSalt()
- Returns:
trueif this hash creator requires a salt,falseif not.
-
createPasswordHash
@Nonnull public String createPasswordHash(@Nullable IPasswordSalt aSalt, @Nonnull String sPlainTextPassword)
Description copied from interface:IPasswordHashCreatorThe 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.
-
-