public 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 and Description |
---|---|
static int |
DEFAULT_ITERATIONS |
DEFAULT_SALT_LENGTH, sm
Constructor and Description |
---|
MessageDigestCredentialHandler() |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm() |
protected int |
getDefaultIterations() |
String |
getEncoding() |
protected Log |
getLog() |
boolean |
matches(String inputCredentials,
String storedCredentials)
Checks to see if the input credentials match the stored credentials
|
protected String |
mutate(String inputCredentials,
byte[] salt,
int iterations)
Generates the equivalent stored credentials for the given input
credentials, salt and iterations.
|
void |
setAlgorithm(String algorithm)
Set the algorithm used to convert input credentials to stored
credentials.
|
void |
setEncoding(String encodingName) |
getDefaultSaltLength, getIterations, getLogInvalidStoredCredentials, getSaltLength, matchesSaltIterationsEncoded, mutate, setIterations, setLogInvalidStoredCredentials, setSaltLength
public static final int DEFAULT_ITERATIONS
public String getEncoding()
public void setEncoding(String encodingName)
public String getAlgorithm()
getAlgorithm
in class DigestCredentialHandlerBase
public void setAlgorithm(String algorithm) throws NoSuchAlgorithmException
DigestCredentialHandlerBase
setAlgorithm
in class DigestCredentialHandlerBase
algorithm
- the algorithmNoSuchAlgorithmException
- if the specified algorithm
is not supportedpublic boolean matches(String inputCredentials, String storedCredentials)
CredentialHandler
inputCredentials
- User provided credentialsstoredCredentials
- Credentials stored in the Realm
true
if the inputCredentials match the
storedCredentials, otherwise false
protected String mutate(String inputCredentials, byte[] salt, int iterations)
DigestCredentialHandlerBase
mutate
in class DigestCredentialHandlerBase
inputCredentials
- 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 credentialsprotected int getDefaultIterations()
getDefaultIterations
in class DigestCredentialHandlerBase
CredentialHandler
.protected Log getLog()
getLog
in class DigestCredentialHandlerBase
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.