dev.turingcomplete.kotlinonetimepassword.TimeBasedOneTimePasswordConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-onetimepassword Show documentation
Show all versions of kotlin-onetimepassword Show documentation
A Kotlin one-time password library to generate "Google Authenticator", "Time-based One-time Password" (TOTP) and "HMAC-based One-time Password" (HOTP) codes based on RFC 4226 and 6238.
package dev.turingcomplete.kotlinonetimepassword
import java.util.concurrent.TimeUnit
/**
* The configuration for the [TimeBasedOneTimePasswordGenerator].
*
* @property timeStep represents together with the [timeStepUnit] parameter the
* time range in which the challenge is valid (e.g. 30 seconds).
* @property timeStepUnit see [timeStep]
* @property codeDigits see documentation in [HmacOneTimePasswordConfig].
* @property hmacAlgorithm see documentation in [HmacOneTimePasswordConfig].
*/
open class TimeBasedOneTimePasswordConfig(val timeStep: Long,
val timeStepUnit: TimeUnit,
codeDigits: Int,
hmacAlgorithm: HmacAlgorithm): HmacOneTimePasswordConfig(codeDigits, hmacAlgorithm)