public interface OneTimePassword extends OneWayPassword
Modifier and Type | Field and Description |
---|---|
static String |
ALGORITHM_OTP_MD5
The algorithm name "otp-md5".
|
static String |
ALGORITHM_OTP_SHA_256
The algorithm name "otp-sha256".
|
static String |
ALGORITHM_OTP_SHA_384
The algorithm name "otp-sha384".
|
static String |
ALGORITHM_OTP_SHA_512
The algorithm name "otp-sha512".
|
static String |
ALGORITHM_OTP_SHA1
The algorithm name "otp-sha1".
|
static int |
OTP_HASH_SIZE
The constant size of the hash, in bytes.
|
serialVersionUID
Modifier and Type | Method and Description |
---|---|
OneTimePassword |
clone()
Creates and returns a copy of this
Password . |
static OneTimePassword |
createRaw(String algorithm,
byte[] hash,
String seed,
int sequenceNumber)
Create a raw implementation of this password type.
|
byte[] |
getHash()
Get the hash represented by this password.
|
default OneTimePasswordAlgorithmSpec |
getParameterSpec()
Get the applicable algorithm parameter specification for this password type.
|
String |
getSeed()
Get the seed used to generate the hash.
|
int |
getSequenceNumber()
Get the sequence number used to generate the hash.
|
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_OTP_MD5
static final String ALGORITHM_OTP_SHA1
static final String ALGORITHM_OTP_SHA_256
static final String ALGORITHM_OTP_SHA_384
static final String ALGORITHM_OTP_SHA_512
static final int OTP_HASH_SIZE
byte[] getHash()
String getSeed()
int getSequenceNumber()
default OneTimePasswordAlgorithmSpec 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
otherwiseOneTimePassword clone()
Password
.clone
in interface OneWayPassword
clone
in interface Password
Password
.static OneTimePassword createRaw(String algorithm, byte[] hash, String seed, int sequenceNumber)
PasswordFactory
(via the PasswordFactory.translate(Password)
method)
before it can be validated and used to verify guesses.algorithm
- the algorithm namehash
- the hashseed
- the seedsequenceNumber
- the sequence numberCopyright © 2017 JBoss by Red Hat. All rights reserved.