Interface ScramDigestPassword
- All Superinterfaces:
Cloneable,Key,OneWayPassword,Password,Serializable
A SCRAM-digest password, used by the SCRAM family of SASL mechanisms.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe algorithm "scram-sha-1".static final StringThe algorithm "scram-sha-256".static final StringThe algorithm "scram-sha-384".static final StringThe algorithm "scram-sha-512".static final intThe default iteration count for this password type.static final intThe default salt size for this password type.Fields inherited from interface java.security.Key
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of thisPassword.static ScramDigestPasswordCreate a raw implementation of this password type.byte[]Get the digest represented by this password.intGet the iteration count used to generate the digest.Get the applicable algorithm parameter specification for this password type.byte[]getSalt()Get the salt used to generate the digest.default booleanimpliesParameters(AlgorithmParameterSpec parameterSpec) Determine if this password is matched by the given parameter specification.Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormatMethods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs
-
Field Details
-
ALGORITHM_SCRAM_SHA_1
The algorithm "scram-sha-1".- See Also:
-
ALGORITHM_SCRAM_SHA_256
The algorithm "scram-sha-256".- See Also:
-
ALGORITHM_SCRAM_SHA_384
The algorithm "scram-sha-384".- See Also:
-
ALGORITHM_SCRAM_SHA_512
The algorithm "scram-sha-512".- See Also:
-
DEFAULT_SALT_SIZE
static final int DEFAULT_SALT_SIZEThe default salt size for this password type.- See Also:
-
DEFAULT_ITERATION_COUNT
static final int DEFAULT_ITERATION_COUNTThe default iteration count for this password type.- See Also:
-
-
Method Details
-
getDigest
byte[] getDigest()Get the digest represented by this password.- Returns:
- the digest represented by this password
-
getSalt
byte[] getSalt()Get the salt used to generate the digest.- Returns:
- the salt used to generate the digest
-
getIterationCount
int getIterationCount()Get the iteration count used to generate the digest.- Returns:
- the iteration count used to generate the digest
-
getParameterSpec
Description copied from interface:PasswordGet the applicable algorithm parameter specification for this password type.- Specified by:
getParameterSpecin interfacePassword- Returns:
- the algorithm parameter specification, or
nullif this password type does not support algorithms
-
impliesParameters
Description copied from interface:PasswordDetermine if this password is matched by the given parameter specification.- Specified by:
impliesParametersin interfacePassword- Parameters:
parameterSpec- the parameter specification (must not benull)- Returns:
trueif the password is matched by the parameters,falseotherwise
-
clone
ScramDigestPassword clone()Creates and returns a copy of thisPassword.- Specified by:
clonein interfaceOneWayPassword- Specified by:
clonein interfacePassword- Returns:
- a copy of this
Password.
-
createRaw
static ScramDigestPassword createRaw(String algorithm, byte[] digest, byte[] salt, int iterationCount) Create a raw implementation of this password type. No validation of the content is performed, and the password must be "adopted" in to aPasswordFactory(via thePasswordFactory.translate(Password)method) before it can be validated and used to verify guesses.- Parameters:
algorithm- the algorithm namedigest- the digestsalt- the saltiterationCount- the iteration count- Returns:
- the raw password implementation
-