TOTP class

TOTP class will generate the OTP (One Time Password) object with the current or given time.

Constructors

TOTP({String secret, int digits: 6, int interval: 30, OTPAlgorithm algorithm: OTPAlgorithm.SHA1 })
This constructor will create an TOTP instance. [...]

Properties

extraUrlProperties → Map<String, dynamic>
To access custom properties when generating the url.
read-only
interval ↔ int
Period in which should be generated new tokens.
read / write
type OTPType
The type of the token.
read-only
algorithm OTPAlgorithm
The crypto algorithm used on HMAC encoding.
read / write, inherited
digits ↔ int
The length of the one-time password, between 6 and 8.
read / write, inherited
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
secret ↔ String
The Base32 secret key used to generate the one-time password.
read / write, inherited

Methods

now() → String
Generate the TOTP value with current time. [...]
value({DateTime date }) → String
Generate the OTP with a custom time. [...]
verify({String otp, DateTime time }) → bool
Verifies the TOTP value passed in against the current time. [...]
generateOTP({int input, OTPAlgorithm algorithm: OTPAlgorithm.SHA1 }) → String
When class HOTP or TOTP pass the input params to this function, it will generate the OTP object with params, the params may be counter or time. [...]
inherited
generateUrl({String issuer, String account }) → String
Generate a url with OTP instance. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited