OathCodeGenerator

open class OathCodeGenerator

This singleton is an utility used to generate TOTP and HOTP tokens for registered accounts.

Constructors

Link copied to clipboard
private constructor(storageClient: StorageClient)
Private constructor restricted to this class itself

Properties

Link copied to clipboard
private open var INSTANCE: OathCodeGenerator
Link copied to clipboard
private open var storageClient: StorageClient
StorageClient to persist OathMechanism updates
Link copied to clipboard
private val TAG: String

Functions

Link copied to clipboard
Generates a new set of codes for this token.
Link copied to clipboard
Return the OathCodeGenerator instance
open fun getInstance(storageClient: StorageClient): OathCodeGenerator
Initialize/Return the OathCodeGenerator instance
Link copied to clipboard
private open fun getOTP(counter: Long, digits: Int, secretStr: String, algo: String): String
Compute new OTP code
Link copied to clipboard
open fun reset()