Interface BSDUnixDESCryptPassword
- All Superinterfaces:
Cloneable,Key,OneWayPassword,Password,Serializable
A BSD-style DES "crypt" password.
- Author:
- David M. Lloyd
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe algorithm name.static final intThe constant size of the hash, in bytes.static final intThe constant size of the salt, in bytes.static final intThe default iteration count.Fields inherited from interface java.security.Key
serialVersionUID -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of thisPassword.static BSDUnixDESCryptPasswordCreate a raw implementation of this password type.byte[]getHash()Get the hash segment of this password.intGet the iteration count of this password.Get the applicable algorithm parameter specification for this password type.intgetSalt()Get the salt segment of this password as anintvalue.default booleanimpliesParameters(AlgorithmParameterSpec parameterSpec) Determine if this password is matched by the given parameter specification.Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormatMethods inherited from interface org.wildfly.security.password.Password
castAndApply, castAndApply, castAs, castAs
-
Field Details
-
ALGORITHM_BSD_CRYPT_DES
The algorithm name.- See Also:
-
BSD_CRYPT_DES_HASH_SIZE
static final int BSD_CRYPT_DES_HASH_SIZEThe constant size of the hash, in bytes.- See Also:
-
BSD_CRYPT_DES_SALT_SIZE
static final int BSD_CRYPT_DES_SALT_SIZEThe constant size of the salt, in bytes.- See Also:
-
DEFAULT_ITERATION_COUNT
static final int DEFAULT_ITERATION_COUNTThe default iteration count.- See Also:
-
-
Method Details
-
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 anintvalue.- Returns:
- the salt segment
-
getHash
byte[] getHash()Get the hash segment of this password.- Returns:
- the hash segment
-
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
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
BSDUnixDESCryptPassword clone()Creates and returns a copy of thisPassword.- Specified by:
clonein interfaceOneWayPassword- Specified by:
clonein 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
-