Class TOTPMechanism

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

    public class TOTPMechanism
    extends OathMechanism
    Represents Time-based OTP authentication mechanism and is responsible for its related operation.
    • Method Detail

      • getPeriod

        public long getPeriod()
        Returns the period of this OathMechanism. The frequency with which the OTP changes in seconds
        Returns:
        period as long value
      • 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 TOTPMechanism deserialize​(java.lang.String jsonString)
        Deserializes the specified Json into an object of the TOTPMechanism object.
        Parameters:
        jsonString - the json string representing the object to be deserialized
        Returns:
        an TOTPMechanism object from the string. Returns null if jsonString is null, if jsonString is empty or not able to parse it.
      • builder

        public static TOTPMechanism.TOTPBuilder builder()
        Returns a builder for creating a TOTPMechanism Mechanism.
        Returns:
        The OathMechanism builder.