public class DigestPasswordHasher extends java.lang.Object implements PasswordHasher
java.security.MessageDigest
mechanism for hashing passwords.
After digestifying the password it is then encoded using the
binary-to-text encoding scheme specified by the
encoding property ("base16" by default).
This hasher does not support one-time hashing (e.g. login passwords are encoded the same way every time).
java.security.MessageDigest;,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLASS_VERSION |
| Constructor and Description |
|---|
DigestPasswordHasher() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPassword(java.lang.String pLoginPassword,
java.lang.String pEncryptedPassword,
java.lang.Object pHashKey)
Returns true if the login password matches the encrypted password.
|
java.lang.String |
encryptPassword(java.lang.String pPassword)
Encrypts a password suitable for long-term storage.
|
java.lang.String |
getAlgorithm()
Returns the name of the digestifying algorithm used by this
password hasher.
|
java.lang.String |
getEncoding()
Returns the name of the encoding scheme used to convert the encrypted
password into a string.
|
PasswordHasher |
getLoginPasswordHasher()
Returns a password hasher instance useful for performing a login.
|
java.lang.Object |
getPasswordHashKey()
Returns the hash key (if any) that was used for hashing the
password for login.
|
java.lang.String |
getPwdHasherComponentPath()
Returns a password hasher component path which is useful when checking if
two password hashers are same or not
|
java.lang.String |
hashPasswordForLogin(java.lang.String pPassword)
Performs the appropriate hashing function for a login process.
|
void |
setAlgorithm(java.lang.String pAlgorithm)
Changes the name of the digestifying algorithm used by this
password hasher.
|
void |
setEncoding(java.lang.String pMethod)
Changes the encoding scheme used to convert the encrypted password
into a string.
|
void |
setPwdHasherComponentPath(java.lang.String pwdHasherComponentPath) |
public java.lang.String getAlgorithm()
public void setAlgorithm(java.lang.String pAlgorithm)
public java.lang.String getEncoding()
BinaryToTextEncoderspublic void setEncoding(java.lang.String pMethod)
BinaryToTextEncoderspublic void setPwdHasherComponentPath(java.lang.String pwdHasherComponentPath)
public java.lang.String getPwdHasherComponentPath()
PasswordHashergetPwdHasherComponentPath in interface PasswordHasherpublic java.lang.String encryptPassword(java.lang.String pPassword)
encryptPassword in interface PasswordHasherpublic boolean checkPassword(java.lang.String pLoginPassword,
java.lang.String pEncryptedPassword,
java.lang.Object pHashKey)
checkPassword in interface PasswordHasherpublic java.lang.String hashPasswordForLogin(java.lang.String pPassword)
hashPasswordForLogin in interface PasswordHasherpublic java.lang.Object getPasswordHashKey()
getPasswordHashKey in interface PasswordHasherpublic PasswordHasher getLoginPasswordHasher()
getLoginPasswordHasher in interface PasswordHasher