TimeBasedOneTimePasswordConfig

open class TimeBasedOneTimePasswordConfig(    val timeStep: Long,     val timeStepUnit: TimeUnit,     val codeDigits: Int,     val hmacAlgorithm: HmacAlgorithm) : HmacOneTimePasswordConfig

The configuration for the TimeBasedOneTimePasswordGenerator.

Throws

if timeStep is negative.

Constructors

Link copied to clipboard
fun TimeBasedOneTimePasswordConfig(    timeStep: Long,     timeStepUnit: TimeUnit,     codeDigits: Int,     hmacAlgorithm: HmacAlgorithm)

Properties

Link copied to clipboard
val codeDigits: Int

the length of the generated code. The RFC 4226 requires a code digits value between 6 and 8 to assure a good security trade-off. However, this library does not set any requirement for this property. But notice that through the design of the algorithm the maximum code value is 2,147,483,647. Which means that a larger code digits value than 10 just adds more trailing zeros to the code (and in case of 10 digits the first number is always 0, 1 or 2).

Link copied to clipboard
val hmacAlgorithm: HmacAlgorithm

the "keyed-hash message authentication code" algorithm to use to generate the hash, from which the code is extracted (see HmacAlgorithm for available algorithms).

Link copied to clipboard
val timeStep: Long

represents together with the timeStepUnit parameter the time range in which the challenge is valid (e.g. 30 seconds).

Link copied to clipboard
val timeStepUnit: TimeUnit