OathMechanism

abstract class OathMechanism : Mechanism

Represents an instance of a OATH authentication mechanism.

Inheritors

Constructors

Link copied to clipboard
protected constructor(mechanismUID: String, issuer: String, accountName: String, type: String, oathType: OathMechanism.TokenType, algorithm: String, secret: String, digits: Int, timeCreated: Calendar)

Types

Link copied to clipboard
Builder class responsible for producing a Token.
Link copied to clipboard

Properties

Link copied to clipboard
private open var account: Account
The Account associated with this mechanism
Link copied to clipboard
AccountName, or Username of the account for the issuer
Link copied to clipboard
protected open var algorithm: String
Algorithm of HMAC-based OTP
Link copied to clipboard
protected open var digits: Int
Digits as in Int for length of OTP credentials
Link copied to clipboard
open val id: String
Unique identifier of the Mechanism
Link copied to clipboard
Issuer of the account
Link copied to clipboard
Uniquely identifiable UUID for current mechanism
Link copied to clipboard
val MFAUTH: String = "mfauth"
URI scheme for combined registration OATH and PUSH at once
Link copied to clipboard
val OATH: String = "otpauth"
URI scheme for OATH registration
Link copied to clipboard
OATH type, must be either 'TOTP' or 'HOTP'
Link copied to clipboard
val PUSH: String = "pushauth"
URI scheme for PUSH registration
Link copied to clipboard
private val secret: String
The shared secret of the Mechanism
Link copied to clipboard
Date this object was stored
Link copied to clipboard
The TimeKeeper
Link copied to clipboard
The type of the Mechanism

Functions

Link copied to clipboard
abstract fun compareTo(p: T): Int
open fun compareTo(another: Mechanism): Int
Link copied to clipboard
open fun deserialize(jsonString: String): Mechanism
Deserializes the specified Json into an object of the Mechanism object.
open fun deserialize(jsonString: String): OathMechanism
Deserializes the specified Json into an object of the OathMechanism object.
Link copied to clipboard
open fun equals(o: Any): Boolean
Link copied to clipboard
open fun getAccount(): Account
Gets the account object associated with the mechanism.
Link copied to clipboard
open fun getAccountId(): String
Gets the storage Account id associated with this Mechanism.
Link copied to clipboard
open fun getAlgorithm(): String
Returns the algorithm used by this OathMechanism.
Link copied to clipboard
open fun getDate(milliSeconds: Long): Calendar
Return date from milliseconds.
Link copied to clipboard
open fun getDigits(): Int
Returns the number of digits that are in OTPs generated by this Token.
Link copied to clipboard
Generates a new set of codes for this OathMechanism Token.
Link copied to clipboard
open fun getSecret(): String
Get the string used to represent the shared secret of the mechanism.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
abstract fun matches(object: T): Boolean
Returns true if the two objects would conflict if added to a storage system.
Link copied to clipboard
abstract fun serialize(): String
Serializes the T object into its equivalent Json representation.
Link copied to clipboard
open fun setAccount(account: Account)
Sets the account object associated with the mechanism.
Link copied to clipboard
open fun setTimeKeeper(timeKeeper: TimeKeeper)
Used for Time Travel during testing.
Link copied to clipboard
abstract fun toJson(): String
Creates a JSON string representation of T object.