Interface UnixDESCryptPassword
-
- All Superinterfaces:
Cloneable
,Key
,OneWayPassword
,Password
,Serializable
- All Known Implementing Classes:
RawUnixDESCryptPassword
,UnixDESCryptPasswordImpl
public interface UnixDESCryptPassword extends OneWayPassword
The traditional UNIX DES crypt password algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGORITHM_CRYPT_DES
The algorithm name "crypt-des".-
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 UnixDESCryptPassword
clone()
Creates and returns a copy of thisPassword
.static UnixDESCryptPassword
createRaw(String algorithm, short salt, byte[] hash)
Create a raw implementation of this password type.byte[]
getHash()
Get the crypt bytes, not including the salt.default SaltedPasswordAlgorithmSpec
getParameterSpec()
Get the applicable algorithm parameter specification for this password type.short
getSalt()
Get the salt of this password as ashort
.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_CRYPT_DES
static final String ALGORITHM_CRYPT_DES
The algorithm name "crypt-des".- See Also:
- Constant Field Values
-
-
Method Detail
-
getSalt
short getSalt()
Get the salt of this password as ashort
.- Returns:
- the salt
-
getHash
byte[] getHash()
Get the crypt bytes, not including the salt.- Returns:
- the crypt bytes
-
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
UnixDESCryptPassword 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 UnixDESCryptPassword createRaw(String algorithm, short salt, byte[] hash)
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 namesalt
- the salthash
- the hash- Returns:
- the raw password implementation
-
-