public interface SoftOathSettings
Modifier and Type | Interface and Description |
---|---|
static class |
SoftOathSettings.OathHashAlgorithm
Supported hash algorithms for HMAC computation
|
static class |
SoftOathSettings.OathTimestepType
Supported types of Time step.
|
static class |
SoftOathSettings.OcraChallengeQuestionFormat
Supported formats for the Question (Q) in the OCRA computation.
|
static class |
SoftOathSettings.OcraPasswordHashAlgorithm
Supported password hash algorithm.
|
Modifier and Type | Method and Description |
---|---|
void |
setHotpHashAlgorithm(SoftOathSettings.OathHashAlgorithm hashAlgorithm)
Set the HOTP hash algorithm.
|
void |
setHotpLength(int otpLength)
Set the HOTP length.
|
void |
setOcraChallengeQuestionFormat(SoftOathSettings.OcraChallengeQuestionFormat challengeQuestionFormat)
Set the format of the challenge question (Q)
|
void |
setOcraCounterUsed(boolean useCounter)
Enable/Disable the counter (C) in OCRA computation.
|
void |
setOcraHashAlgorithm(SoftOathSettings.OathHashAlgorithm hashAlgorithm)
Set the OCRA hash algorithm.
|
void |
setOcraMaximumChallengeQuestionLength(int maxChallengeQuestionLength)
Set the maximum challenge question length.
|
void |
setOcraOtpLength(int otpLength)
Set the OCRA OTP length.
|
void |
setOcraPasswordHashAlgorithm(SoftOathSettings.OcraPasswordHashAlgorithm hashAlgorithm)
Set the password Hash algorithm, set to OcraPasswordHashAlgorithm.NONE to not use it
|
void |
setOcraSessionLength(int sessionLength)
Set the maximum length in bytes of the Session (S) in UTF-8 encoding.
|
void |
setOcraSuite(SecureString ocrasuite)
Set the Ocra Suite, all the relevant OCRA settings will be set accordingly.
|
void |
setOcraTimeSettings(SoftOathSettings.OathTimestepType timestepType,
int timestepSize,
long startTime)
Set the OCRA time settings.
|
void |
setTotpHashAlgorithm(SoftOathSettings.OathHashAlgorithm hashAlgorithm)
Set the TOTP hash algorithm.
|
void |
setTotpLength(int otpLength)
Set the TOTP length.
|
void |
setTotpStartTime(long startTime)
Set the T0 value for TOTP computation.
|
void |
setTotpTimestepSize(int timestepSize)
Set the TOTP time step size.
|
void |
setTotpTimestepType(SoftOathSettings.OathTimestepType timestepType)
Set the TOTP time step type.
|
void setHotpLength(int otpLength)
otpLength
- the OTP length. Allowed range is 6-10 digits.IllegalArgumentException
- when otpLength is not in allowed range.void setHotpHashAlgorithm(SoftOathSettings.OathHashAlgorithm hashAlgorithm)
SoftOathSettings.OathHashAlgorithm.SHA1
and SoftOathSettings.OathHashAlgorithm.SHA256
hash algorithm.hashAlgorithm
- the hmac algorithm.void setTotpLength(int otpLength)
otpLength
- the OTP length. Allowed range is 6-10 digits.IllegalArgumentException
- when otpLength is not in allowed range.void setTotpHashAlgorithm(SoftOathSettings.OathHashAlgorithm hashAlgorithm)
hashAlgorithm
- the hmac algorithm.void setTotpStartTime(long startTime)
startTime
- value to start counting time steps. Default value is 0.IllegalArgumentException
- when startTime is negative.void setTotpTimestepSize(int timestepSize)
timestepSize
- the time step size. Default value is 30IllegalArgumentException
- when timestepSize is less than or equal to 0.void setTotpTimestepType(SoftOathSettings.OathTimestepType timestepType)
timestepType
- the time step type. Default value is SecondsIllegalArgumentException
- when timestepSize is less than or equal to 0.void setOcraOtpLength(int otpLength)
otpLength
- the OTP length. 0 for full length or any value in the range 4-10 digits.IllegalArgumentException
- when otpLength is not in allowed range.void setOcraHashAlgorithm(SoftOathSettings.OathHashAlgorithm hashAlgorithm)
hashAlgorithm
- the hmac algorithm.void setOcraTimeSettings(SoftOathSettings.OathTimestepType timestepType, int timestepSize, long startTime)
timestepType
- the time step type, set to OathTimestepType.NONE to not use ittimestepSize
- the time step size, it is ignored if timestepType is NONEstartTime
- the start time, it is ignored if timestepType is NONEIllegalArgumentException
- when at least one of these condition is true:
SoftOathSettings.OathTimestepType.NONE
and
timestepSize is less than or equal to zero.
SoftOathSettings.OathTimestepType.NONE
and startTime
is less than zero.
SoftOathSettings.OathTimestepType.SECONDS
and
timestepSize is greater than 59.
SoftOathSettings.OathTimestepType.MINUTES
and
timestepSize is greater than 59.
SoftOathSettings.OathTimestepType.HOURS
and
timestepSize is greater than 48.
void setOcraCounterUsed(boolean useCounter)
useCounter
- True to enable.void setOcraChallengeQuestionFormat(SoftOathSettings.OcraChallengeQuestionFormat challengeQuestionFormat)
challengeQuestionFormat
- the format of the Challenge questionvoid setOcraSessionLength(int sessionLength)
sessionLength
- the length of the Session. -1 to not use session in Ocra computation or any value in the range 1-512. Default value is -1 (not used)IllegalArgumentException
- when at least one of these condition is true:
void setOcraPasswordHashAlgorithm(SoftOathSettings.OcraPasswordHashAlgorithm hashAlgorithm)
hashAlgorithm
- the Password Hash algorithmvoid setOcraMaximumChallengeQuestionLength(int maxChallengeQuestionLength)
maxChallengeQuestionLength
- the maximum length of the challenge string regardless of the format (e.g. the number of nibbles in hexadecimal format or the maximum number of digits in numerical format). Any value in the range 4-64.IllegalArgumentException
- when maxChallengeQuestionLength is not in allowed range.void setOcraSuite(SecureString ocrasuite)
setOcraTimeSettings(com.gemalto.idp.mobile.otp.oath.soft.SoftOathSettings.OathTimestepType, int, long)
if startTime needs to be tweaked.ocrasuite
- the Ocra SuiteIllegalArgumentException
- when the ocrasuite is invalid.