Interface BSDUnixDESCryptPassword
-
- All Superinterfaces:
Cloneable
,Key
,OneWayPassword
,Password
,Serializable
- All Known Implementing Classes:
BSDUnixDESCryptPasswordImpl
,RawBSDUnixDESCryptPassword
public interface BSDUnixDESCryptPassword extends OneWayPassword
A BSD-style DES "crypt" password.- Author:
- David M. Lloyd
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM_BSD_CRYPT_DES
The algorithm name.static int
BSD_CRYPT_DES_HASH_SIZE
The constant size of the hash, in bytes.static int
BSD_CRYPT_DES_SALT_SIZE
The constant size of the salt, in bytes.static int
DEFAULT_ITERATION_COUNT
The default iteration count.-
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 BSDUnixDESCryptPassword
clone()
Creates and returns a copy of thisPassword
.static BSDUnixDESCryptPassword
createRaw(String algorithm, byte[] hash, int salt, int iterationCount)
Create a raw implementation of this password type.byte[]
getHash()
Get the hash segment 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.int
getSalt()
Get the salt segment of this password as anint
value.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_BSD_CRYPT_DES
static final String ALGORITHM_BSD_CRYPT_DES
The algorithm name.- See Also:
- Constant Field Values
-
BSD_CRYPT_DES_HASH_SIZE
static final int BSD_CRYPT_DES_HASH_SIZE
The constant size of the hash, in bytes.- See Also:
- Constant Field Values
-
BSD_CRYPT_DES_SALT_SIZE
static final int BSD_CRYPT_DES_SALT_SIZE
The constant size of the salt, in bytes.- See Also:
- Constant Field Values
-
DEFAULT_ITERATION_COUNT
static final int DEFAULT_ITERATION_COUNT
The default iteration count.- See Also:
- Constant Field Values
-
-
Method Detail
-
getIterationCount
int getIterationCount()
Get the iteration count of this password.- Returns:
- the iteration count
-
getSalt
int getSalt()
Get the salt segment of this password as anint
value.- Returns:
- the salt segment
-
getHash
byte[] getHash()
Get the hash segment of this password.- Returns:
- the hash segment
-
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
BSDUnixDESCryptPassword 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 BSDUnixDESCryptPassword createRaw(String algorithm, byte[] hash, int 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 namehash
- the hashsalt
- the saltiterationCount
- the iteration count- Returns:
- the raw password implementation
-
-