Interface SaltedSimpleDigestPassword
-
- All Superinterfaces:
Cloneable
,Key
,OneWayPassword
,Password
,Serializable
public interface SaltedSimpleDigestPassword extends OneWayPassword
A simple password where the generated digest also includes a salt.- Author:
- Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM_PASSWORD_SALT_DIGEST_MD5
Algorithm name for digest created using MD5 with the password digested first followed by the salt.static String
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_1
Algorithm name for digest created using SHA-1 with the password digested first followed by the salt.static String
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_256
Algorithm name for digest created using SHA-256 with the password digested first followed by the salt.static String
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_384
Algorithm name for digest created using SHA-384 with the password digested first followed by the salt.static String
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_512
Algorithm name for digest created using SHA-512 with the password digested first followed by the salt.static String
ALGORITHM_SALT_PASSWORD_DIGEST_MD5
Algorithm name for digest created using MD5 with the salt digested first followed by the password.static String
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_1
Algorithm name for digest created using SHA-1 with the salt digested first followed by the password.static String
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_256
Algorithm name for digest created using SHA-256 with the salt digested first followed by the password.static String
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_384
Algorithm name for digest created using SHA-384 with the salt digested first followed by the password.static String
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_512
Algorithm name for digest created using SHA-512 with the salt digested first followed by the password.static int
DEFAULT_SALT_SIZE
The default salt size (in bytes), used when generating a random salt.-
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 SaltedSimpleDigestPassword
clone()
Creates and returns a copy of thisPassword
.static SaltedSimpleDigestPassword
createRaw(String algorithm, byte[] digest, byte[] salt)
Create a raw implementation of this password type.byte[]
getDigest()
Get the digest represented by this password.default SaltedPasswordAlgorithmSpec
getParameterSpec()
Get the applicable algorithm parameter specification for this password type.byte[]
getSalt()
Get the salt used to generate the digest.default boolean
impliesParameters(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_PASSWORD_SALT_DIGEST_MD5
static final String ALGORITHM_PASSWORD_SALT_DIGEST_MD5
Algorithm name for digest created using MD5 with the password digested first followed by the salt.- See Also:
- Constant Field Values
-
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_1
static final String ALGORITHM_PASSWORD_SALT_DIGEST_SHA_1
Algorithm name for digest created using SHA-1 with the password digested first followed by the salt.- See Also:
- Constant Field Values
-
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_256
static final String ALGORITHM_PASSWORD_SALT_DIGEST_SHA_256
Algorithm name for digest created using SHA-256 with the password digested first followed by the salt.- See Also:
- Constant Field Values
-
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_384
static final String ALGORITHM_PASSWORD_SALT_DIGEST_SHA_384
Algorithm name for digest created using SHA-384 with the password digested first followed by the salt.- See Also:
- Constant Field Values
-
ALGORITHM_PASSWORD_SALT_DIGEST_SHA_512
static final String ALGORITHM_PASSWORD_SALT_DIGEST_SHA_512
Algorithm name for digest created using SHA-512 with the password digested first followed by the salt.- See Also:
- Constant Field Values
-
ALGORITHM_SALT_PASSWORD_DIGEST_MD5
static final String ALGORITHM_SALT_PASSWORD_DIGEST_MD5
Algorithm name for digest created using MD5 with the salt digested first followed by the password.- See Also:
- Constant Field Values
-
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_1
static final String ALGORITHM_SALT_PASSWORD_DIGEST_SHA_1
Algorithm name for digest created using SHA-1 with the salt digested first followed by the password.- See Also:
- Constant Field Values
-
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_256
static final String ALGORITHM_SALT_PASSWORD_DIGEST_SHA_256
Algorithm name for digest created using SHA-256 with the salt digested first followed by the password.- See Also:
- Constant Field Values
-
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_384
static final String ALGORITHM_SALT_PASSWORD_DIGEST_SHA_384
Algorithm name for digest created using SHA-384 with the salt digested first followed by the password.- See Also:
- Constant Field Values
-
ALGORITHM_SALT_PASSWORD_DIGEST_SHA_512
static final String ALGORITHM_SALT_PASSWORD_DIGEST_SHA_512
Algorithm name for digest created using SHA-512 with the salt digested first followed by the password.- See Also:
- Constant Field Values
-
DEFAULT_SALT_SIZE
static final int DEFAULT_SALT_SIZE
The default salt size (in bytes), used when generating a random salt.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
-
getParameterSpec
default SaltedPasswordAlgorithmSpec getParameterSpec()
Description copied from interface:Password
Get the applicable algorithm parameter specification for this password type.- Specified by:
getParameterSpec
in interfacePassword
- Returns:
- the algorithm parameter specification, or
null
if this password type does not support algorithms
-
impliesParameters
default boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
Description copied from interface:Password
Determine if this password is matched by the given parameter specification.- Specified by:
impliesParameters
in interfacePassword
- Parameters:
parameterSpec
- the parameter specification (must not benull
)- Returns:
true
if the password is matched by the parameters,false
otherwise
-
clone
SaltedSimpleDigestPassword clone()
Creates and returns a copy of thisPassword
.- Specified by:
clone
in interfaceOneWayPassword
- Specified by:
clone
in interfacePassword
- Returns:
- a copy of this
Password
.
-
createRaw
static SaltedSimpleDigestPassword createRaw(String algorithm, byte[] digest, byte[] salt)
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 salt- Returns:
- the raw password implementation
-
-