public class TimeBasedOTPUtil extends Object
TimeBasedOTP
classConstructor and Description |
---|
TimeBasedOTPUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
validate(String submittedOTP,
byte[] secret,
int numDigits)
Validate a submitted OTP string
|
static boolean |
validate256(String submittedOTP,
byte[] secret,
int numDigits)
Validate a submitted OTP string using HMAC_256
|
static boolean |
validate512(String submittedOTP,
byte[] secret,
int numDigits)
Validate a submitted OTP string using HMAC_512
|
public static boolean validate(String submittedOTP, byte[] secret, int numDigits) throws GeneralSecurityException
submittedOTP
- OTP string to validatesecret
- Shared secretGeneralSecurityException
public static boolean validate256(String submittedOTP, byte[] secret, int numDigits) throws GeneralSecurityException
submittedOTP
- OTP string to validatesecret
- Shared secretGeneralSecurityException
public static boolean validate512(String submittedOTP, byte[] secret, int numDigits) throws GeneralSecurityException
submittedOTP
- OTP string to validatesecret
- Shared secretGeneralSecurityException
Copyright © 2018 JBoss by Red Hat. All rights reserved.