public class Hotp extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Hotp.HashAlgorithm |
| Constructor and Description |
|---|
Hotp(Hotp.HashAlgorithm algorithm,
int length)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
String |
generate(byte[] key,
long counter)
Generates an HOTP value according to RFC 4226
|
public Hotp(Hotp.HashAlgorithm algorithm, int length)
algorithm - the algorithm to uselength - the number of digitspublic String generate(byte[] key, long counter)
key - the shared secret ('K')counter - the counter ('C') valueCopyright © 2020 National Institute of Standards and Technology. All rights reserved.