Interface DigestPassword
-
- All Superinterfaces:
Cloneable,Key,OneWayPassword,Password,Serializable
public interface DigestPassword extends OneWayPassword
Digest MD5 (pre-digested) password.- Author:
- Peter Skopek, Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description static StringALGORITHM_DIGEST_MD5The algorithm name "digest-md5".static StringALGORITHM_DIGEST_SHAThe algorithm name "digest-sha".static StringALGORITHM_DIGEST_SHA_256The algorithm name "digest-sha-256".static StringALGORITHM_DIGEST_SHA_384The algorithm name "digest-sha-384".static StringALGORITHM_DIGEST_SHA_512The algorithm name "digest-sha-512".static StringALGORITHM_DIGEST_SHA_512_256The algorithm name "digest-sha-512-256".-
Fields inherited from interface java.security.Key
serialVersionUID
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DigestPasswordclone()Creates and returns a copy of thisPassword.static DigestPasswordcreateRaw(String algorithm, String username, String realm, byte[] digest)Create a raw implementation of this password type.byte[]getDigest()Get the digest represented by thisPassword.default DigestPasswordAlgorithmSpecgetParameterSpec()Get the applicable algorithm parameter specification for this password type.StringgetRealm()Get the realm thisPasswordis associated with.StringgetUsername()Get the username thisPasswordis associated with.default booleanimpliesParameters(AlgorithmParameterSpec parameterSpec)Determine if this password is matched by the given parameter specification.-
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
-
Methods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs
-
-
-
-
Field Detail
-
ALGORITHM_DIGEST_MD5
static final String ALGORITHM_DIGEST_MD5
The algorithm name "digest-md5".- See Also:
- Constant Field Values
-
ALGORITHM_DIGEST_SHA
static final String ALGORITHM_DIGEST_SHA
The algorithm name "digest-sha".- See Also:
- Constant Field Values
-
ALGORITHM_DIGEST_SHA_256
static final String ALGORITHM_DIGEST_SHA_256
The algorithm name "digest-sha-256".- See Also:
- Constant Field Values
-
ALGORITHM_DIGEST_SHA_384
static final String ALGORITHM_DIGEST_SHA_384
The algorithm name "digest-sha-384".- See Also:
- Constant Field Values
-
ALGORITHM_DIGEST_SHA_512
static final String ALGORITHM_DIGEST_SHA_512
The algorithm name "digest-sha-512".- See Also:
- Constant Field Values
-
ALGORITHM_DIGEST_SHA_512_256
static final String ALGORITHM_DIGEST_SHA_512_256
The algorithm name "digest-sha-512-256". (Using SHA-512/256)- See Also:
- Constant Field Values
-
-
Method Detail
-
getUsername
String getUsername()
Get the username thisPasswordis associated with.Generally a
Passwordshould not need to know this information but this is an integral part of how the representation of thisPasswordis created.- Returns:
- the username this
Passwordis associated with
-
getRealm
String getRealm()
Get the realm thisPasswordis associated with.Note: This is independent of the name of the realm used to obtain the
Passwordrepresentation, this is the value used to generate the digest.- Returns:
- the realm this
Passwordis associated with
-
getDigest
byte[] getDigest()
Get the digest represented by thisPassword.- Returns:
- the digest represented by this
Password
-
getParameterSpec
default DigestPasswordAlgorithmSpec 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
default boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
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
DigestPassword clone()
Creates and returns a copy of thisPassword.- Specified by:
clonein interfaceOneWayPassword- Specified by:
clonein interfacePassword- Returns:
- a copy of this
Password.
-
createRaw
static DigestPassword createRaw(String algorithm, String username, String realm, byte[] digest)
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 nameusername- the user namerealm- the realmdigest- the digest- Returns:
- the raw password implementation
-
-