public class HOTPMechanism extends OathMechanism
| Modifier and Type | Class and Description |
|---|---|
static class |
HOTPMechanism.HOTPBuilder
Builder class responsible for producing a TOTPMechanism Token.
|
OathMechanism.OathBuilder<T extends OathMechanism.OathBuilder>, OathMechanism.TokenType| Modifier and Type | Field and Description |
|---|---|
protected long |
counter
Counter as in Int for number of OTP credentials generated
|
algorithm, digits| Modifier and Type | Method and Description |
|---|---|
static HOTPMechanism.HOTPBuilder |
builder()
Returns a builder for creating a HOTPMechanism Mechanism.
|
static HOTPMechanism |
deserialize(java.lang.String jsonString)
Deserializes the specified Json into an object of the
HOTPMechanism object. |
OathTokenCode |
getOathTokenCode()
Generates a new set of codes for this OathMechanism Token.
|
java.lang.String |
toJson()
Creates a JSON string representation of
T object. |
getAlgorithm, getDigits, getOathTypecompareTo, equals, getAccountName, getId, getIssuer, getMechanismUID, getTimeAdded, getType, hashCode, matchesprotected long counter
public OathTokenCode getOathTokenCode() throws OathMechanismException
OathMechanismgetOathTokenCode in class OathMechanismOathMechanismException - If an error occur on generating the OTP codespublic java.lang.String toJson()
T object. Sensitive information are not
exposed.toJson in class OathMechanismpublic static HOTPMechanism deserialize(java.lang.String jsonString)
HOTPMechanism object.jsonString - the json string representing the object to be deserializedHOTPMechanism object from the string. Returns null if jsonString is null,
if jsonString is empty or not able to parse it.public static HOTPMechanism.HOTPBuilder builder()