public class SecretKeyCredentialHandler extends DigestCredentialHandlerBase
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_ALGORITHM |
static int |
DEFAULT_ITERATIONS |
static int |
DEFAULT_KEY_LENGTH |
DEFAULT_SALT_LENGTH, sm
Constructor and Description |
---|
SecretKeyCredentialHandler() |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
Get the algorithm used to convert input credentials to stored
credentials.
|
protected int |
getDefaultIterations()
Get the default number of iterations used by the
CredentialHandler . |
int |
getKeyLength() |
protected Log |
getLog()
Obtain the logger for the CredentialHandler instance.
|
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 |
setKeyLength(int keyLength) |
getDefaultSaltLength, getIterations, getLogInvalidStoredCredentials, getSaltLength, matchesSaltIterationsEncoded, mutate, setIterations, setLogInvalidStoredCredentials, setSaltLength
public static final String DEFAULT_ALGORITHM
public static final int DEFAULT_KEY_LENGTH
public static final int DEFAULT_ITERATIONS
public SecretKeyCredentialHandler() throws NoSuchAlgorithmException
NoSuchAlgorithmException
public String getAlgorithm()
DigestCredentialHandlerBase
getAlgorithm
in class DigestCredentialHandlerBase
public void setAlgorithm(String algorithm) throws NoSuchAlgorithmException
DigestCredentialHandlerBase
setAlgorithm
in class DigestCredentialHandlerBase
NoSuchAlgorithmException
public int getKeyLength()
public void setKeyLength(int keyLength)
public 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()
DigestCredentialHandlerBase
CredentialHandler
.getDefaultIterations
in class DigestCredentialHandlerBase
protected Log getLog()
DigestCredentialHandlerBase
getLog
in class DigestCredentialHandlerBase
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.