public interface BCryptPassword extends OneWayPassword
Modifier and Type | Field and Description |
---|---|
static String |
ALGORITHM_BCRYPT
The algorithm name.
|
static int |
BCRYPT_HASH_SIZE
A constant representing the bcrypt hash size, in bytes.
|
static int |
BCRYPT_SALT_SIZE
A constant representing the bcrypt salt size, in bytes.
|
static int |
DEFAULT_ITERATION_COUNT
A constant representing the default iteration count for bcrypt passwords.
|
serialVersionUID
Modifier and Type | Method and Description |
---|---|
BCryptPassword |
clone()
Creates and returns a copy of this
Password . |
static BCryptPassword |
createRaw(String algorithm,
byte[] hash,
byte[] 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.
|
byte[] |
getSalt()
Get the salt segment of this password.
|
default boolean |
impliesParameters(AlgorithmParameterSpec parameterSpec)
Determine if this password is matched by the given parameter specification.
|
castAndApply, castAndApply, castAs, castAs
getAlgorithm, getEncoded, getFormat
static final String ALGORITHM_BCRYPT
static final int BCRYPT_SALT_SIZE
static final int BCRYPT_HASH_SIZE
static final int DEFAULT_ITERATION_COUNT
byte[] getHash()
byte[] getSalt()
int getIterationCount()
BCryptPassword clone()
Password
.clone
in interface OneWayPassword
clone
in interface Password
Password
.default IteratedSaltedPasswordAlgorithmSpec getParameterSpec()
Password
getParameterSpec
in interface Password
null
if this password type does not support algorithmsdefault boolean impliesParameters(AlgorithmParameterSpec parameterSpec)
Password
impliesParameters
in interface Password
parameterSpec
- the parameter specification (must not be null
)true
if the password is matched by the parameters, false
otherwisestatic BCryptPassword createRaw(String algorithm, byte[] hash, byte[] salt, int iterationCount)
PasswordFactory
(via the PasswordFactory.translate(Password)
method)
before it can be validated and used to verify guesses.algorithm
- the algorithm namehash
- the hashsalt
- the saltiterationCount
- the iteration countCopyright © 2020 JBoss by Red Hat. All rights reserved.