TOTP
public class TOTP
- Utility class to work with time-based OTP feature.
Method Summary
| Parameters | ||
|---|---|---|
| String | getOTP() | Returns OTP. The default expiry time is 30 seconds. |
| String | getRemainingSecs() | Returns remaining time after which the OTP will expire. |
| void | setOTP(totp: String) | Sets new OTP. |
| void | setRemainingSecond(remainingSecond: Int) | Sets remaining time after which the OTP will expire. |
Method Details
getOTP
public String getOTP()
- Returns an OTP that is valid for 30 seconds. If this method is called multiple times within the 30-second window, the same OTP value is returned.
getRemainingSecs
public getRemainingSecs()
- Returns the remaining time after which the OTP will expire.
setOTP
public func setOTP(totp: String)
- Sets new OTP.
| Parameters | ||
|---|---|---|
| totp | String | The new TOTP value. |
getRemainingSecs
public func setRemainingSecond(remainingSecond: Int)
- Sets remaining time after which the OTP will expire.
| Parameters | ||
|---|---|---|
| remainingSecond | int | Number of seconds remaining after which the TOTP will expire. |