|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.security.PasswordHasher2Adapter atg.security.SaltedDigestPasswordHasher
public class SaltedDigestPasswordHasher
A password hasher that utilizes the java.security.MessageDigest
mechanism for hashing passwords. The login name is used as a salt.
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 FormField Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Constructor Summary | |
---|---|
SaltedDigestPasswordHasher()
Creates a SaltedDigestPasswordHasher with a random hash key. |
|
SaltedDigestPasswordHasher(java.lang.Long pHashKey)
Creates a SaltedDigestPasswordHasher using a pre-existing hash key. |
Method Summary | |
---|---|
boolean |
checkPassword(java.lang.String pLogin,
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 pLogin,
java.lang.String pPassword)
Encrypts a password suitably for long-term storage. |
java.lang.String |
generateSalt()
generate a salt |
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. |
int |
getHashIterations()
get HashIterations |
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. |
int |
getSaltSize()
get SaltSize |
java.lang.String |
hashPasswordForLogin(java.lang.String pLogin,
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 |
setHashIterations(int pHashIterations)
set HashIterations |
void |
setSaltSize(int pSaltSize)
set SaltSize |
Methods inherited from class atg.security.PasswordHasher2Adapter |
---|
checkPassword, encryptPassword, hashPasswordForLogin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public SaltedDigestPasswordHasher()
public SaltedDigestPasswordHasher(java.lang.Long pHashKey)
Method Detail |
---|
public java.lang.String getAlgorithm()
public void setAlgorithm(java.lang.String pAlgorithm)
public java.lang.String getEncoding()
BinaryToTextEncoders
public void setEncoding(java.lang.String pMethod)
BinaryToTextEncoders
public void setHashIterations(int pHashIterations)
pHashIterations
- the HashIterationspublic int getHashIterations()
public void setSaltSize(int pSaltSize)
pSaltSize
- the SaltSizepublic int getSaltSize()
public java.lang.Object getPasswordHashKey()
public PasswordHasher getLoginPasswordHasher()
public java.lang.String encryptPassword(java.lang.String pLogin, java.lang.String pPassword)
public boolean checkPassword(java.lang.String pLogin, java.lang.String pLoginPassword, java.lang.String pEncryptedPassword, java.lang.Object pHashKey)
public java.lang.String hashPasswordForLogin(java.lang.String pLogin, java.lang.String pPassword)
public java.lang.String generateSalt()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |