Package dev.turingcomplete.kotlinonetimepassword

Types

Link copied to clipboard
class GoogleAuthenticator(base32secret: ByteArray)

This class is a decorator of the TimeBasedOneTimePasswordGenerator that provides the default values used by the Google Authenticator:

Link copied to clipboard
enum HmacAlgorithm : Enum<HmacAlgorithm>

Available "keyed-hash message authentication code" (HMAC) algorithms. See: https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#Mac

Link copied to clipboard
open class HmacOneTimePasswordConfig(val codeDigits: Int, val hmacAlgorithm: HmacAlgorithm)

The configuration for the HmacOneTimePasswordGenerator.

Link copied to clipboard
open class HmacOneTimePasswordGenerator(secret: ByteArray, config: HmacOneTimePasswordConfig)

Generator for the RFC 4226 "HOTP: An HMAC-Based One-Time Password Algorithm" (https://tools.ietf.org/html/rfc4226)

Link copied to clipboard
open class OtpAuthUriBuilder<S : OtpAuthUriBuilder<S>>(    type: String,     base32Secret: ByteArray,     removePaddingFromBase32Secret: Boolean = true,     charset: Charset = StandardCharsets.UTF_8)

A builder to create an OTP Auth URI as defined in Key Uri Format. This URI contains all necessary information for a TOTP/HOTP client to set up the code generation.

Link copied to clipboard
class RandomSecretGenerator

Generator to create a secure random secret via SecureRandom.

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

The configuration for the TimeBasedOneTimePasswordGenerator.

Link copied to clipboard
open class TimeBasedOneTimePasswordGenerator(secret: ByteArray, config: TimeBasedOneTimePasswordConfig)

Generator for the RFC 6238 "TOTP: Time-Based One-Time Password Algorithm" (https://tools.ietf.org/html/rfc6238)