Class OtpProvider


  • @Component
    public class OtpProvider
    extends Object
    This class contains methods to generate OTP.
    Since:
    1.0.0
    Author:
    Ritesh Sinha
    • Constructor Detail

      • OtpProvider

        public OtpProvider()
    • Method Detail

      • computeOtp

        public String computeOtp​(String key,
                                 int otpLength,
                                 String macAlgorithm)
        This method compute OTP against provided key and macAlgo.
        Parameters:
        key - the key against which OTP generates.
        otpLength - the length of OTP.
        macAlgorithm - the crypto algorithm.
        Returns:
        the string OTP.