TOTP class
Methods
-
generateQRCodeUri(String appName, String secretKey, {String issuer = 'totp_authenticator', int interval = 30})
→ String
-
- appName : App name
- secretKey: Secret key
- issuer: Issuer name, default: totp_authenticator
-
generateQRCodeUrl(String appName, String secretKey, {String issuer = 'totp_authenticator'})
→ String
-
Returns a URL for ready QR Code
-
generateTOTPCode(String secretKey, {int interval = 30, int? time})
→ String
-
Generates an OTP code based on the provided secret and interval.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
-
verifyCode(String secretKey, String otpCode, {int interval = 30, int discrepancy = 1})
→ bool
-
Verifies a given TOTP code against a secret key.
Static Methods
-
generateSecret({int length = 16})
→ String
-
The secret is generated using the Base32 alphabet and is suitable for
use in TOTP (Time-based One-Time Password) applications.