OathTokenCode
public class OathTokenCode : NSObject, Codable
OathTokenCode represents OTP credentials as an object generated with HOTPMechnism, and/or TOTPMechanism
-
OathTokenType as in String; either ‘hotp’, or ‘totp’
Declaration
Swift
public let tokenType: String
-
Oath code
Declaration
Swift
public let code: String
-
Started timestamp of current Oath token; timestamp in seconds since
Declaration
Swift
public let start: TimeInterval
-
Expiration timestamp of current Oath token; for HOTP, ‘until’ property returns nil as it does not expires
Declaration
Swift
public let until: TimeInterval?
-
Boolean property indicating whether or not current OathTokenCode is valid; for HOTP, isValid always returns ‘true’ and for TOTP. This property computes, start and until timestamps of OathTokenCode and determines its validity
Declaration
Swift
public var isValid: Bool { get }
-
Float value that represents percentage until current Oath code expires; ranging from 0.0 to 1.0 Warning: For
HOTPMechanism
, progress always returns 0.0; actual progress value is only returned forTOTPMechanism
Declaration
Swift
public var progress: Float { get }
-
Serializes
OathTokenCode
object into JSON StringDeclaration
Swift
public func toJson() -> String?
Return Value
JSON String value of
OathTokenCode
object