Class HOTPMechanism

  • All Implemented Interfaces:
    java.lang.Comparable<Mechanism>

    public class HOTPMechanism
    extends OathMechanism
    Represents HMAC-based OTP authentication mechanism and is responsible for its related operation.
    • Field Detail

      • counter

        protected long counter
        Counter as in Int for number of OTP credentials generated
    • Method Detail

      • toJson

        public java.lang.String toJson()
        Creates a JSON string representation of ModelObject object. Sensitive information are not exposed.
        Specified by:
        toJson in class OathMechanism
        Returns:
        a JSON string object
      • deserialize

        public static HOTPMechanism deserialize​(java.lang.String jsonString)
        Deserializes the specified Json into an object of the HOTPMechanism object.
        Parameters:
        jsonString - the json string representing the object to be deserialized
        Returns:
        an HOTPMechanism object from the string. Returns null if jsonString is null, if jsonString is empty or not able to parse it.
      • builder

        public static HOTPMechanism.HOTPBuilder builder()
        Returns a builder for creating a HOTPMechanism Mechanism.
        Returns:
        The OathMechanism builder.