pub struct TOTP { /* fields omitted */ }
Provides Time based One Time Passwords.
- This object implements utilities for RFC6328.
Creates a new TOTP instance.
secret
- HOTP secret to use for TOTP generation.
time_step
- The time frame to allow every password, in seconds. RFC6238 recommends 30 seconds.
start_time
- Configurable T0 for OTP.
Generates a time based OTP.
digits
- Desired OTP length, should be at least 6.
offset
- Should be 0 for current time frame, -1 for previous, 1 for next, etc...
Validates the given OTP.
digits
- The amount of digits set for the OTP.
guess
- The user provided guess to validate.
buffer
- Amount of OTPs to check before and after the current one (0=Only current, 1=Previous+Now+Next OTP, etc...)