HOTP class
HOTP class will generate the OTP (One Time Password) object with given counter.
Constructors
- HOTP({required String secret, int counter = 0, int digits = 6, OTPAlgorithm algorithm = OTPAlgorithm.SHA1})
- This constructor will create an HOTP instance.
Properties
- algorithm ↔ OTPAlgorithm
-
The crypto algorithm used on HMAC encoding.
getter/setter pairinherited
- counter ↔ int
-
The counter value for one-time password.
getter/setter pair
- digits ↔ int
-
The length of the one-time password, between 6 and 8.
getter/setter pairinherited
-
extraUrlProperties
→ Map<
String, dynamic> -
To access custom properties when generating the url.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secret ↔ String
-
The Base32 secret key used to generate the one-time password.
getter/setter pairinherited
- type → OTPType
-
The type of the token.
no setter
Methods
-
at(
{int? counter}) → String? - Generate the HOTP value with the given count
-
generateOTP(
{required int input, OTPAlgorithm? algorithm}) → 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 nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
verify(
{String? otp, int? counter}) → bool - Verifies the HOTP value passed in against the a given counter.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited