Package org.cryptacular.generator
Class HOTPGenerator
java.lang.Object
org.cryptacular.generator.AbstractOTPGenerator
org.cryptacular.generator.HOTPGenerator
OTP generator component that implements the HOTP scheme described in
RFC 4226.
- Author:
- Middleware Services
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.cryptacular.generator.AbstractOTPGenerator
generateInternal, getNumberOfDigits, setNumberOfDigits
-
Constructor Details
-
HOTPGenerator
public HOTPGenerator()
-
-
Method Details
-
generate
public int generate(byte[] key, long count) Generates the OTP given a per-user key and invocation count.- Parameters:
key
- Per-user key.count
- Counter moving factor.- Returns:
- Integer OTP.
-
getDigest
protected org.bouncycastle.crypto.Digest getDigest()- Specified by:
getDigest
in classAbstractOTPGenerator
- Returns:
- Digest algorithm used for HMAC operation.
-