public class TOTPMechanism extends OathMechanism
| Modifier and Type | Class and Description |
|---|---|
static class |
TOTPMechanism.TOTPBuilder
Builder class responsible for producing a TOTPMechanism Token.
|
OathMechanism.OathBuilder<T extends OathMechanism.OathBuilder>, OathMechanism.TokenTypealgorithm, digits| Modifier and Type | Method and Description |
|---|---|
static TOTPMechanism.TOTPBuilder |
builder()
Returns a builder for creating a TOTPMechanism Mechanism.
|
static TOTPMechanism |
deserialize(java.lang.String jsonString)
Deserializes the specified Json into an object of the
TOTPMechanism object. |
OathTokenCode |
getOathTokenCode()
Generates a new set of codes for this OathMechanism Token.
|
long |
getPeriod()
Returns the period of this OathMechanism.
|
java.lang.String |
toJson()
Creates a JSON string representation of
T object. |
getAlgorithm, getDigits, getOathTypecompareTo, equals, getAccountName, getId, getIssuer, getMechanismUID, getTimeAdded, getType, hashCode, matchespublic long getPeriod()
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 TOTPMechanism deserialize(java.lang.String jsonString)
TOTPMechanism object.jsonString - the json string representing the object to be deserializedTOTPMechanism object from the string. Returns null if jsonString is null,
if jsonString is empty or not able to parse it.public static TOTPMechanism.TOTPBuilder builder()