public class MD5PasswordHasher extends java.lang.Object implements PasswordHasher
This is intended to be useful for applications where a one-time hash is desired, e.g. when performing a client/server log-in.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
Constructor and Description |
---|
MD5PasswordHasher()
Construct a new MD5PasswordHasher with a randomized initial state.
|
MD5PasswordHasher(java.lang.Long pInitialHashState)
Construct a new MD5PasswordHasher with the given initial state.
|
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)
Hashes a password suitably for long-term storage.
|
PasswordHasher |
getLoginPasswordHasher()
Returns a password hasher instance useful for performing a login.
|
java.lang.Object |
getPasswordHashKey()
Returns the hash key that was used for hashing the password
for login.
|
java.lang.String |
getPwdHasherComponentPath()
Gets the PasswordHasher component path used.
|
java.lang.String |
hashPasswordForLogin(java.lang.String pPassword)
Performs the appropriate hashing function for a login process.
|
static void |
main(java.lang.String[] args)
Simple command-line interface for deriving MD5 hashed passwords.
|
void |
setPwdHasherComponentPath(java.lang.String pwdHasherComponentPath)
Sets the PasswordHasher component path used.
|
public MD5PasswordHasher()
public MD5PasswordHasher(java.lang.Long pInitialHashState)
public void setPwdHasherComponentPath(java.lang.String pwdHasherComponentPath)
public java.lang.String getPwdHasherComponentPath()
getPwdHasherComponentPath
in interface PasswordHasher
public java.lang.String encryptPassword(java.lang.String pPassword)
encryptPassword
in interface PasswordHasher
public boolean checkPassword(java.lang.String pLoginPassword, java.lang.String pEncryptedPassword, java.lang.Object pHashKey)
checkPassword
in interface PasswordHasher
public java.lang.String hashPasswordForLogin(java.lang.String pPassword)
hashPasswordForLogin
in interface PasswordHasher
public java.lang.Object getPasswordHashKey()
getPasswordHashKey
in interface PasswordHasher
public PasswordHasher getLoginPasswordHasher()
getLoginPasswordHasher
in interface PasswordHasher
public static void main(java.lang.String[] args)