public abstract class AbstractOTPGenerator
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static int[] |
MODULUS
Array of modulus values indexed per number of digits in OTP output.
|
private int |
numberOfDigits
Number of digits in generated OTP.
|
| Constructor and Description |
|---|
AbstractOTPGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
generateInternal(byte[] key,
long count)
Internal OTP generation method.
|
protected abstract org.bouncycastle.crypto.Digest |
getDigest() |
int |
getNumberOfDigits() |
void |
setNumberOfDigits(int digits)
Sets the numbers in the generated OTP.
|
private int |
truncate(byte[] hmac)
Truncates HMAC output onto an unsigned (i.e.
|
private static final int[] MODULUS
private int numberOfDigits
public int getNumberOfDigits()
public void setNumberOfDigits(int digits)
digits - Number of digits in generated OTP. MUST be in the range 6 - 9. Default is 6.protected int generateInternal(byte[] key,
long count)
key - Per-user key.count - Counter moving factor.protected abstract org.bouncycastle.crypto.Digest getDigest()
private int truncate(byte[] hmac)
hmac - HMAC output.