public abstract class DigestCredentialHandlerBase extends Object implements CredentialHandler
CredentialHandler
s.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SALT_LENGTH |
protected static StringManager |
sm |
Constructor and Description |
---|
DigestCredentialHandlerBase() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getAlgorithm()
Get the algorithm used to convert input credentials to stored
credentials.
|
protected abstract int |
getDefaultIterations()
Get the default number of iterations used by the
CredentialHandler . |
protected int |
getDefaultSaltLength()
Get the default salt length used by the
CredentialHandler . |
int |
getIterations()
Return the number of iterations of the associated algorithm that will be
used when creating a new stored credential for a given input credential.
|
protected abstract Log |
getLog()
Obtain the logger for the CredentialHandler instance.
|
boolean |
getLogInvalidStoredCredentials()
When checking input credentials against stored credentials will a warning
message be logged if invalid stored credentials are discovered?
|
int |
getSaltLength()
Return the salt length that will be used when creating a new stored
credential for a given input credential.
|
protected boolean |
matchesSaltIterationsEncoded(String inputCredentials,
String storedCredentials)
Checks whether the provided credential matches the stored credential when
the stored credential is in the form salt$iteration-count$credential
|
String |
mutate(String userCredential)
Generates the equivalent stored credentials for the given input
credentials.
|
protected abstract String |
mutate(String inputCredentials,
byte[] salt,
int iterations)
Generates the equivalent stored credentials for the given input
credentials, salt and iterations.
|
abstract void |
setAlgorithm(String algorithm)
Set the algorithm used to convert input credentials to stored
credentials.
|
void |
setIterations(int iterations)
Set the number of iterations of the associated algorithm that will be
used when creating a new stored credential for a given input credential.
|
void |
setLogInvalidStoredCredentials(boolean logInvalidStoredCredentials)
Set whether a warning message will be logged if invalid stored
credentials are discovered while checking input credentials against
stored credentials?
|
void |
setSaltLength(int saltLength)
Set the salt length that will be used when creating a new stored
credential for a given input credential.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
matches
protected static final StringManager sm
public static final int DEFAULT_SALT_LENGTH
public int getIterations()
public void setIterations(int iterations)
public int getSaltLength()
public void setSaltLength(int saltLength)
public boolean getLogInvalidStoredCredentials()
public void setLogInvalidStoredCredentials(boolean logInvalidStoredCredentials)
public String mutate(String userCredential)
CredentialHandler
mutate
in interface CredentialHandler
userCredential
- User provided credentialsprotected boolean matchesSaltIterationsEncoded(String inputCredentials, String storedCredentials)
inputCredentials
- The input credentialstoredCredentials
- The stored credentialtrue
if they match, otherwise false
protected int getDefaultSaltLength()
CredentialHandler
.protected abstract String mutate(String inputCredentials, byte[] salt, int iterations)
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 credentialspublic abstract void setAlgorithm(String algorithm) throws NoSuchAlgorithmException
NoSuchAlgorithmException
public abstract String getAlgorithm()
protected abstract int getDefaultIterations()
CredentialHandler
.protected abstract Log getLog()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.