public class OATH extends Object
OATH implements OATH HOTP/TOTP validation| Modifier and Type | Method and Description |
|---|---|
static String |
HOTP(YubiHSM hsm,
int keyHandle,
String nonce,
String aead,
int counter,
String otp)
Validate OTP by a token whose seed is available to the YubiHSM through an AEAD.
|
static String |
truncate(String hmac,
int otpLength)
Truncate HMAC to an OTP code
|
static int |
validateHOTP(YubiHSM hsm,
int keyHandle,
String nonce,
String aead,
int counter,
String otp,
int lookAhead)
Validate OATH-HOTP OTP by a token whose seed is available to the YubiHSM through an AEAD.
|
static boolean |
validateTOTP(YubiHSM hsm,
int keyHandle,
String nonce,
String aead,
String otp,
int period,
int drift,
int backwardDrift,
int forwardDrift)
Validate OATH-TOTP OTP by a token whose seed is available to the YubiHSM through an AEAD.
|
public static String HOTP(YubiHSM hsm, int keyHandle, String nonce, String aead, int counter, String otp) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
hsm - the current hsm objectkeyHandle - a keyHandle with the permission YSM_TEMP_KEY_LOAD enablednonce - the nonce used to generate the AEADaead - the AEAD based on the token seedcounter - the current OTP counterotp - the token OTPYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionpublic static int validateHOTP(YubiHSM hsm, int keyHandle, String nonce, String aead, int counter, String otp, int lookAhead) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
hsm - the current hsm objectkeyHandle - a keyHandle with the permission YSM_TEMP_KEY_LOAD enablednonce - the nonce used to generate the AEADaead - the AEAD based on the token seedcounter - the current OTP counterotp - the token OTPlookAhead - the number of iterations to run to find the current users OTPYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionpublic static boolean validateTOTP(YubiHSM hsm, int keyHandle, String nonce, String aead, String otp, int period, int drift, int backwardDrift, int forwardDrift) throws YubiHSMInputException, YubiHSMCommandFailedException, YubiHSMErrorException
hsm - the current hsm objectkeyHandle - a keyHandle with the permission YSM_TEMP_KEY_LOAD enablednonce - the nonce used to generate the AEADaead - the AEAD based on the token seedotp - the token OTPperiod - an integer giving the period between changes of the OTP value in secondsdrift - drift of the local clock to the client clock, can be used to adjust the time skew without
changing the size of @backwardDrift and @forwardDriftbackwardDrift - the number of @period's we allow to backstepforwardDrift - the number of @period's we allow to look aheadYubiHSMInputException - argument exceptionsYubiHSMCommandFailedException - command failed exceptionYubiHSMErrorException - error exceptionpublic static String truncate(String hmac, int otpLength) throws YubiHSMInputException
hmac - the hmacotpLength - the length of the OTP (6-8 digits)YubiHSMInputException - argument exceptionsCopyright © 2011-2016 United ID. All Rights Reserved.