Package io.mosip.kernel.otpmanager.util
Class OtpManagerUtils
- java.lang.Object
-
- io.mosip.kernel.otpmanager.util.OtpManagerUtils
-
@RefreshScope @Component public class OtpManagerUtils extends Object
This utility class defines some of the utility methods used in OTP validation.- Since:
- 1.0.0
- Author:
- Sagar Mahapatra, Ritesh Sinha
-
-
Constructor Summary
Constructors Constructor Description OtpManagerUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LocalDateTimegetCurrentLocalDateTime()This method returns the current LocalDateTime.static inttimeDifferenceInSeconds(LocalDateTime fromDateTime, LocalDateTime toDateTime)This method returns the difference between two LocalDateTime objects in seconds.voidvalidateOtpRequestArguments(String key, String otp)This method validates the input arguments provided for validation.
-
-
-
Method Detail
-
timeDifferenceInSeconds
public static int timeDifferenceInSeconds(LocalDateTime fromDateTime, LocalDateTime toDateTime)
This method returns the difference between two LocalDateTime objects in seconds.- Parameters:
fromDateTime- The time from which the difference needs to be calculated.toDateTime- The time till which the difference needs to be calculated.- Returns:
- The difference in seconds.
-
getCurrentLocalDateTime
public static LocalDateTime getCurrentLocalDateTime()
This method returns the current LocalDateTime.- Returns:
- The current local date and time.
-
-