Interface OtpValidator<D>
-
public interface OtpValidator<D>This interface provides the methods which can be used for OTP validation.- Since:
- 1.0.0
- Author:
- Sagar Mahapatra
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DvalidateOtp(String key, String otp)This method can be used to validate OTP against an existing key and a given OTP.
-
-
-
Method Detail
-
validateOtp
D validateOtp(String key, String otp)
This method can be used to validate OTP against an existing key and a given OTP.- Parameters:
key- the key against which the given OTP needs to be validated.otp- the given OTP that will be validated against the generated OTP.- Returns:
- returns true if the given OTP matches against the existing OTP. returns false if the given OTP doesn't matches against the existing OTP. returns false if the given OTP matches against the existing OTP but the expiry limit is reached. returns false if the given OTP matches against the existing OTP but the OTP is consumed.
-
-