public class SecretKeyCredentialHandler extends DigestCredentialHandlerBase
| Modifier and Type | Field and Description |
|---|---|
static java.lang.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 |
|---|---|
java.lang.String |
getAlgorithm() |
protected int |
getDefaultIterations() |
int |
getKeyLength() |
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.
|
protected java.lang.String |
mutate(java.lang.String inputCredentials,
byte[] salt,
int iterations,
int keyLength)
Generates the equivalent stored credentials for the given input
credentials, salt, iterations and key length.
|
void |
setAlgorithm(java.lang.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, setSaltLengthpublic static final java.lang.String DEFAULT_ALGORITHM
public static final int DEFAULT_KEY_LENGTH
public static final int DEFAULT_ITERATIONS
public SecretKeyCredentialHandler()
throws java.security.NoSuchAlgorithmException
java.security.NoSuchAlgorithmExceptionpublic 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 int getKeyLength()
public void setKeyLength(int keyLength)
public 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 java.lang.String mutate(java.lang.String inputCredentials,
byte[] salt,
int iterations,
int keyLength)
DigestCredentialHandlerBaseDigestCredentialHandlerBase.mutate(String, byte[], int). Sub-classes that use the key length
should override this method.mutate 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 credentialskeyLength - Length of the produced digest in bits for
implementations where it's applicablenull if the generation failsprotected int getDefaultIterations()
getDefaultIterations in class DigestCredentialHandlerBaseCredentialHandler.protected Log getLog()
getLog in class DigestCredentialHandlerBaseCopyright © 2000-2019 Apache Software Foundation. All Rights Reserved.