CredentialHandlers.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| private int | |
| private boolean | |
| private volatile Random | |
| private final Object | |
| private int | |
| protected static final StringManager |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true if the strings are equal to each other, false otherwise.The first string to compare. s1, final String The second string to compare. s2, final boolean true if the strings should be compared without regard to case. Note that "true"
here is only guaranteed to work with plain ASCII characters.Implements String equality which always compares all characters in the string, without stopping early if any characters do not match. |
| public static boolean | Returns: true if the arrays are equal to each other, false otherwise.The first array to compare. b1, final byte[] The second array to compare. b2)Implements byte-array equality which always compares all bytes in the array, without stopping early if any bytes do not match. |
| public abstract String | |
| protected abstract int | |
| protected int | |
| public int | Returns: 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 | |
| public boolean | Returns: true if logging will occurWhen checking input credentials against stored credentials will a warning message be logged if invalid stored credentials are discovered? |
| public int | Returns: the salt length that will be used when creating a new stored credential for a given input credential.
|
| private void | |
| protected boolean | Returns: true if they match, otherwise falseThe input credential inputCredentials, String The stored credential storedCredentials)Checks whether the provided credential matches the stored credential when the stored credential is in the form salt$iteration-count$credential |
| public String | mutate(String
User provided credentials userCredential)Implements org. Generates the equivalent stored credentials for the given input credentials. |
| protected abstract String | Returns: The equivalent stored credentials for the given input credentials ornull if the generation
failsUser provided credentials inputCredentials, byte[] Salt, if any salt, int Number of iterations of the algorithm associated with this CredentialHandler applied to
the inputCredentials to generate the equivalent stored credentials iterations)Generates the equivalent stored credentials for the given input credentials, salt and iterations. |
| protected String | Returns: The equivalent stored credentials for the given input credentials ornull if the generation
failsUser provided credentials inputCredentials, byte[] Salt, if any salt, int Number of iterations of the algorithm associated with this CredentialHandler applied to
the inputCredentials to generate the equivalent stored credentials iterations, int Length of the produced digest in bits for implementations where it's applicable keyLength)Generates the equivalent stored credentials for the given input credentials, salt, iterations and key length. |
| public abstract void | setAlgorithm(String
the algorithm algorithm)Set the algorithm used to convert input credentials to stored credentials. |
| public void | setIterations(int
the iterations count 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. |
| public void | setLogInvalidStoredCredentials(boolean
true to log, the default value is falseSet whether a warning message will be logged if invalid stored credentials are discovered while checking input credentials against stored credentials? |
| public void | setSaltLength(int
the salt length saltLength)Set the salt length that will be used when creating a new stored credential for a given input credential. |
| DEFAULT_SALT_LENGTH | back to summary |
|---|---|
| public static final int DEFAULT_SALT_LENGTH | |
| iterations | back to summary |
|---|---|
| private int iterations | |
| logInvalidStoredCredentials | back to summary |
|---|---|
| private boolean logInvalidStoredCredentials | |
| random | back to summary |
|---|---|
| private volatile Random random | |
| randomLock | back to summary |
|---|---|
| private final Object randomLock | |
| saltLength | back to summary |
|---|---|
| private int saltLength | |
| sm | back to summary |
|---|---|
| protected static final StringManager sm | |
| DigestCredentialHandlerBase | back to summary |
|---|---|
| public DigestCredentialHandlerBase() | |
| equals | back to summary |
|---|---|
| public static boolean equals(final String s1, final String s2, final boolean ignoreCase) Implements String equality which always compares all characters in the string, without stopping early if any characters do not match. Note This implementation was adapted from
| |
| equals | back to summary |
|---|---|
| public static boolean equals(final byte[] b1, final byte[] b2) Implements byte-array equality which always compares all bytes in the array, without stopping early if any bytes do not match. Note Implementation note: this method delegates to
| |
| getAlgorithm | back to summary |
|---|---|
public abstract String getAlgorithm()
| |
| getDefaultIterations | back to summary |
|---|---|
protected abstract int getDefaultIterations()
| |
| getDefaultSaltLength | back to summary |
|---|---|
protected int getDefaultSaltLength()
| |
| getIterations | back to summary |
|---|---|
public int getIterations()
| |
| getLog | back to summary |
|---|---|
protected abstract Log getLog()
| |
| getLogInvalidStoredCredentials | back to summary |
|---|---|
| public boolean getLogInvalidStoredCredentials() When checking input credentials against stored credentials will a warning message be logged if invalid stored credentials are discovered?
| |
| getSaltLength | back to summary |
|---|---|
public int getSaltLength()
| |
| logInvalidStoredCredentials | back to summary |
|---|---|
| private void logInvalidStoredCredentials(String storedCredentials) | |
| matchesSaltIterationsEncoded | back to summary |
|---|---|
| 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 | |
| mutate | back to summary |
|---|---|
| public String mutate(String userCredential) Implements org. Doc from org. Generates the equivalent stored credentials for the given input credentials. | |
| mutate | back to summary |
|---|---|
| protected abstract String mutate(String inputCredentials, byte[] salt, int iterations) Generates the equivalent stored credentials for the given input credentials, salt and iterations. If the algorithm requires a key length, the default will be used.
| |
| mutate | back to summary |
|---|---|
| protected String mutate(String inputCredentials, byte[] salt, int iterations, int keyLength) Generates the equivalent stored credentials for the given input credentials, salt, iterations and key length. The
default implementation calls ignores the key length and calls
| |
| setAlgorithm | back to summary |
|---|---|
| public abstract void setAlgorithm(String algorithm) throws NoSuchAlgorithmException Set the algorithm used to convert input credentials to stored credentials.
| |
| setIterations | back to summary |
|---|---|
| public 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.
| |
| setLogInvalidStoredCredentials | back to summary |
|---|---|
| public 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?
| |
| setSaltLength | back to summary |
|---|---|
| public void setSaltLength(int saltLength) Set the salt length that will be used when creating a new stored credential for a given input credential.
| |