CredentialHandlerpublic class MessageDigestCredentialHandler extends DigestCredentialHandlerBase
If the stored password form does not include an iteration count then an iteration count of 1 is used.
If the stored password form does not include salt then no salt is used.
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_ITERATIONS |
DEFAULT_SALT_LENGTH, sm| Constructor | Description |
|---|---|
MessageDigestCredentialHandler() |
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.String |
getAlgorithm() |
|
protected int |
getDefaultIterations() |
|
java.lang.String |
getEncoding() |
|
protected Log |
getLog() |
|
boolean |
matches(java.lang.String inputCredentials,
java.lang.String storedCredentials) |
Checks to see if the input credentials match the stored credentials
|
protected java.lang.String |
mutate(java.lang.String inputCredentials,
byte[] salt,
int iterations) |
Generates the equivalent stored credentials for the given input
credentials, salt and iterations.
|
void |
setAlgorithm(java.lang.String algorithm) |
Set the algorithm used to convert input credentials to stored
credentials.
|
void |
setEncoding(java.lang.String encodingName) |
getDefaultSaltLength, getIterations, getLogInvalidStoredCredentials, getSaltLength, matchesSaltIterationsEncoded, mutate, mutate, setIterations, setLogInvalidStoredCredentials, setSaltLengthpublic static final int DEFAULT_ITERATIONS
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encodingName)
public java.lang.String getAlgorithm()
getAlgorithm in class DigestCredentialHandlerBasepublic void setAlgorithm(java.lang.String algorithm)
throws java.security.NoSuchAlgorithmException
DigestCredentialHandlerBasesetAlgorithm in class DigestCredentialHandlerBasealgorithm - the algorithmjava.security.NoSuchAlgorithmException - if the specified algorithm
is not supportedpublic boolean matches(java.lang.String inputCredentials,
java.lang.String storedCredentials)
CredentialHandlerinputCredentials - User provided credentialsstoredCredentials - Credentials stored in the Realmtrue if the inputCredentials match the
storedCredentials, otherwise falseprotected java.lang.String mutate(java.lang.String inputCredentials,
byte[] salt,
int iterations)
DigestCredentialHandlerBasemutate in class DigestCredentialHandlerBaseinputCredentials - User provided credentialssalt - Salt, if anyiterations - Number of iterations of the algorithm associated
with this CredentialHandler applied to the
inputCredentials to generate the equivalent
stored credentialsnull if the generation failsprotected int getDefaultIterations()
getDefaultIterations in class DigestCredentialHandlerBaseCredentialHandler.protected Log getLog()
getLog in class DigestCredentialHandlerBaseCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.