|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.sdk.unboundidds.OneTimePassword
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class OneTimePassword
NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.This class provides support for a number of one-time password algorithms. Supported algorithms include:
Field Summary | |
---|---|
static int |
DEFAULT_HOTP_NUM_DIGITS
The default number of digits to include in generated HOTP passwords. |
static int |
DEFAULT_TOTP_INTERVAL_DURATION_SECONDS
The default time interval (in seconds) to use when generating TOTP passwords. |
static int |
DEFAULT_TOTP_NUM_DIGITS
The default number of digits to include in generated TOTP passwords. |
Method Summary | |
---|---|
static java.lang.String |
hotp(byte[] sharedSecret,
long counter)
Generates a six-digit HMAC-based one-time-password using the provided information. |
static java.lang.String |
hotp(byte[] sharedSecret,
long counter,
int numDigits)
Generates an HMAC-based one-time-password using the provided information. |
static java.lang.String |
totp(byte[] sharedSecret)
Generates a six-digit time-based one-time-password using the provided information and a 30-second time interval. |
static java.lang.String |
totp(byte[] sharedSecret,
long authTime,
int intervalDurationSeconds,
int numDigits)
Generates a six-digit time-based one-time-password using the provided information. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_HOTP_NUM_DIGITS
public static final int DEFAULT_TOTP_INTERVAL_DURATION_SECONDS
public static final int DEFAULT_TOTP_NUM_DIGITS
Method Detail |
---|
public static java.lang.String hotp(byte[] sharedSecret, long counter) throws LDAPException
sharedSecret
- The secret key shared by both parties that will be
using the generated one-time password.counter
- The counter value that will be used in the course of
generating the one-time password.
LDAPException
- If an unexpected problem is encountered while
attempting to generate the one-time password.public static java.lang.String hotp(byte[] sharedSecret, long counter, int numDigits) throws LDAPException
sharedSecret
- The secret key shared by both parties that will be
using the generated one-time password.counter
- The counter value that will be used in the course of
generating the one-time password.numDigits
- The number of digits that should be included in the
generated one-time password. It must be greater than
or equal to six and less than or equal to eight.
LDAPException
- If an unexpected problem is encountered while
attempting to generate the one-time password.public static java.lang.String totp(byte[] sharedSecret) throws LDAPException
sharedSecret
- The secret key shared by both parties that will be
using the generated one-time password.
LDAPException
- If an unexpected problem is encountered while
attempting to generate the one-time password.public static java.lang.String totp(byte[] sharedSecret, long authTime, int intervalDurationSeconds, int numDigits) throws LDAPException
sharedSecret
- The secret key shared by both parties that
will be using the generated one-time
password.authTime
- The time (in milliseconds since the epoch,
as reported by
System.currentTimeMillis
or
Date.getTime
) at which the
authentication attempt occurred.intervalDurationSeconds
- The duration of the time interval, in
seconds, that should be used when
performing the computation.numDigits
- The number of digits that should be
included in the generated one-time
password. It must be greater than or
equal to six and less than or equal to
eight.
LDAPException
- If an unexpected problem is encountered while
attempting to generate the one-time password.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |