Package org.apache.catalina.realm
Class SecretKeyCredentialHandler
java.lang.Object
org.apache.catalina.realm.DigestCredentialHandlerBase
org.apache.catalina.realm.SecretKeyCredentialHandler
- All Implemented Interfaces:
- CredentialHandler
- 
Field SummaryFieldsFields inherited from class org.apache.catalina.realm.DigestCredentialHandlerBaseDEFAULT_SALT_LENGTH, sm
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected intintprotected LoggetLog()booleanChecks to see if the input credentials match the stored credentialsprotected StringGenerates the equivalent stored credentials for the given input credentials, salt and iterations.protected StringGenerates the equivalent stored credentials for the given input credentials, salt, iterations and key length.voidsetAlgorithm(String algorithm) Set the algorithm used to convert input credentials to stored credentials.voidsetKeyLength(int keyLength) Methods inherited from class org.apache.catalina.realm.DigestCredentialHandlerBaseequals, equals, getDefaultSaltLength, getIterations, getLogInvalidStoredCredentials, getSaltLength, matchesSaltIterationsEncoded, mutate, setIterations, setLogInvalidStoredCredentials, setSaltLength
- 
Field Details- 
DEFAULT_ALGORITHM- See Also:
 
- 
DEFAULT_KEY_LENGTHpublic static final int DEFAULT_KEY_LENGTH- See Also:
 
- 
DEFAULT_ITERATIONSpublic static final int DEFAULT_ITERATIONS- See Also:
 
 
- 
- 
Constructor Details- 
SecretKeyCredentialHandler- Throws:
- NoSuchAlgorithmException
 
 
- 
- 
Method Details- 
getAlgorithm- Specified by:
- getAlgorithmin class- DigestCredentialHandlerBase
- Returns:
- the algorithm used to convert input credentials to stored credentials.
 
- 
setAlgorithmDescription copied from class:DigestCredentialHandlerBaseSet the algorithm used to convert input credentials to stored credentials.- Specified by:
- setAlgorithmin class- DigestCredentialHandlerBase
- Parameters:
- algorithm- the algorithm
- Throws:
- NoSuchAlgorithmException- if the specified algorithm is not supported
 
- 
getKeyLengthpublic int getKeyLength()
- 
setKeyLengthpublic void setKeyLength(int keyLength) 
- 
matchesDescription copied from interface:CredentialHandlerChecks to see if the input credentials match the stored credentials- Parameters:
- inputCredentials- User provided credentials
- storedCredentials- Credentials stored in the- Realm
- Returns:
- trueif the inputCredentials match the storedCredentials, otherwise- false
 
- 
mutateDescription copied from class:DigestCredentialHandlerBaseGenerates the equivalent stored credentials for the given input credentials, salt and iterations. If the algorithm requires a key length, the default will be used.- Specified by:
- mutatein class- DigestCredentialHandlerBase
- Parameters:
- inputCredentials- User provided credentials
- salt- Salt, if any
- iterations- Number of iterations of the algorithm associated with this CredentialHandler applied to the inputCredentials to generate the equivalent stored credentials
- Returns:
- The equivalent stored credentials for the given input credentials or nullif the generation fails
 
- 
mutateDescription copied from class:DigestCredentialHandlerBaseGenerates the equivalent stored credentials for the given input credentials, salt, iterations and key length. The default implementation calls ignores the key length and callsDigestCredentialHandlerBase.mutate(String, byte[], int). Sub-classes that use the key length should override this method.- Overrides:
- mutatein class- DigestCredentialHandlerBase
- Parameters:
- inputCredentials- User provided credentials
- salt- Salt, if any
- iterations- Number of iterations of the algorithm associated with this CredentialHandler applied to the inputCredentials to generate the equivalent stored credentials
- keyLength- Length of the produced digest in bits for implementations where it's applicable
- Returns:
- The equivalent stored credentials for the given input credentials or nullif the generation fails
 
- 
getDefaultIterationsprotected int getDefaultIterations()- Specified by:
- getDefaultIterationsin class- DigestCredentialHandlerBase
- Returns:
- the default number of iterations used by the CredentialHandler.
 
- 
getLog- Specified by:
- getLogin class- DigestCredentialHandlerBase
- Returns:
- the logger for the CredentialHandler instance.
 
 
-