public abstract class OtpGeneratorContext
extends java.lang.Object
TotpGeneratorContext
and HotpGeneratorContext
according to
https://tools.ietf.org/html/rfc4226 and
https://tools.ietf.org/html/rfc6238Constructor and Description |
---|
OtpGeneratorContext(java.lang.String secret,
int digits,
HmacAlgorithm algorithm)
Returns a new OtpGeneratorContext with secret, digits and algorithm.
|
public OtpGeneratorContext(java.lang.String secret, int digits, HmacAlgorithm algorithm)
secret
- the secret key used to generate the password, null/empty throws
IllegalArgumentExceptiondigits
- a value of 6 or 8 representing the length of the password to be generated.
The default is 6.algorithm
- the algorithm used to generate the password. The default is HmacSHA1 HmacAlgorithm
.java.lang.IllegalArgumentException
- if any parameter is null or out of boundaries
or if the algorithm is not available