Interface SunUnixMD5CryptPassword
-
- All Superinterfaces:
Cloneable
,Key
,OneWayPassword
,Password
,Serializable
- All Known Implementing Classes:
RawSunUnixMD5CryptPassword
,SunUnixMD5CryptPasswordImpl
public interface SunUnixMD5CryptPassword extends OneWayPassword
An MD5-crypt password using the Sun scheme.- Author:
- Farah Juma
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM_SUN_CRYPT_MD5
The algorithm name "sun-crypt-md5".static String
ALGORITHM_SUN_CRYPT_MD5_BARE_SALT
The algorithm name "sun-crypt-md5-bare-salt".static int
DEFAULT_ITERATION_COUNT
The default iteration count of this password type.static int
DEFAULT_SALT_SIZE
The default salt size of this password type.-
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 SunUnixMD5CryptPassword
clone()
Creates and returns a copy of thisPassword
.static SunUnixMD5CryptPassword
createRaw(String algorithm, byte[] salt, byte[] hash, int iterationCount)
Create a raw implementation of this password type.byte[]
getHash()
Get the hash component of this password.int
getIterationCount()
Get the iteration count of this password.default IteratedSaltedPasswordAlgorithmSpec
getParameterSpec()
Get the applicable algorithm parameter specification for this password type.byte[]
getSalt()
Get the salt component of this password.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_SUN_CRYPT_MD5
static final String ALGORITHM_SUN_CRYPT_MD5
The algorithm name "sun-crypt-md5".- See Also:
- Constant Field Values
-
ALGORITHM_SUN_CRYPT_MD5_BARE_SALT
static final String ALGORITHM_SUN_CRYPT_MD5_BARE_SALT
The algorithm name "sun-crypt-md5-bare-salt".- See Also:
- Constant Field Values
-
DEFAULT_SALT_SIZE
static final int DEFAULT_SALT_SIZE
The default salt size of this password type.- See Also:
- Constant Field Values
-
DEFAULT_ITERATION_COUNT
static final int DEFAULT_ITERATION_COUNT
The default iteration count of this password type.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSalt
byte[] getSalt()
Get the salt component of this password.- Returns:
- the salt
-
getHash
byte[] getHash()
Get the hash component of this password.- Returns:
- the hash
-
getIterationCount
int getIterationCount()
Get the iteration count of this password.- Returns:
- the iteration count
-
getParameterSpec
default IteratedSaltedPasswordAlgorithmSpec 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
SunUnixMD5CryptPassword 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 SunUnixMD5CryptPassword createRaw(String algorithm, byte[] salt, byte[] hash, 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 namehash
- the hashsalt
- the saltiterationCount
- the iteration count- Returns:
- the raw password implementation
-
-