com.ibm.security.access.mobile.authentication

Class HotpChallenge

  • java.lang.Object
    • com.ibm.security.access.mobile.authentication.HotpChallenge
  • All Implemented Interfaces:
    android.os.Parcelable, IChallenge


    public class HotpChallenge
    extends java.lang.Object
    implements IChallenge
    Hash-based One-time Password Algorithm (HOTP) challenge accepts a value that an algorithm has computed to produce a one-time password from a shared secret key.
    Since:
    1.2.0
    Version:
    1.2.8
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static android.os.Parcelable.Creator<HotpChallenge> CREATOR
      Creates an instance from a parcel.
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Constructor Summary

      Constructors 
      Constructor and Description
      HotpChallenge()
      Returns an instance containing a new IChallenge.
      HotpChallenge(java.lang.String messagePrompt)
      Returns an instance containing a new IChallenge with a message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int describeContents()
      Returns a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
      java.lang.String getDescription()
      Returns the description of the mechanism.
      java.lang.String getIdentifier()
      Returns the identifier of the mechanism.
      java.lang.String getMessagePrompt()
      Returns the message to display in the alert when prompted.
      java.lang.String getName()
      Returns the name of the mechanism.
      java.lang.String getPostbackUri()
      Returns the postback URI of the mechanism.
      java.lang.String getState()
      Returns the unique identifier of the mechanism request.
      void launchUI(android.app.Activity activity, IChallengeCallbackHandleUserInput callback)
      This method launches an AlertDialog to prompt for a HMAC based one-time password.
      IChallenge parse(org.json.JSONObject data)
      Returns an instance of IChallenge parsed from the object.
      void setPostbackUri(java.lang.String postbackUri)
      The postback URI of the mechanism.
      void setState(java.lang.String state)
      Set the unique identifier of the mechanism request.
      void writeToParcel(android.os.Parcel parcel, int i)
      Writes the object into a parcel.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CREATOR

        public static final android.os.Parcelable.Creator<HotpChallenge> CREATOR
        Creates an instance from a parcel.
        Since:
        1.2.2
    • Constructor Detail

      • HotpChallenge

        public HotpChallenge()
        Returns an instance containing a new IChallenge.
      • HotpChallenge

        public HotpChallenge(java.lang.String messagePrompt)
        Returns an instance containing a new IChallenge with a message.
        Parameters:
        messagePrompt - the message to display
        Throws:
        java.lang.IllegalArgumentException - if parameter is null
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the mechanism.
        Returns:
        the name of the mechanism
      • getIdentifier

        public java.lang.String getIdentifier()
        Returns the identifier of the mechanism. For example: urn:ibm:security:authentication:asf:mechanism:hotp
        Specified by:
        getIdentifier in interface IChallenge
        Returns:
        identifier of the mechanism
      • getDescription

        public java.lang.String getDescription()
        Returns the description of the mechanism.
        Specified by:
        getDescription in interface IChallenge
        Returns:
        description of the mechanism
      • parse

        public IChallenge parse(org.json.JSONObject data)
        Returns an instance of IChallenge parsed from the object.
        Specified by:
        parse in interface IChallenge
        Parameters:
        data - the object to deserialize from
        Returns:
        the deserialized IChallenge, or null if data cannot be parsed.
      • setPostbackUri

        public void setPostbackUri(java.lang.String postbackUri)
        The postback URI of the mechanism.
        Specified by:
        setPostbackUri in interface IChallenge
        Parameters:
        postbackUri - the postback URI of the mechanism
        Throws:
        java.lang.IllegalArgumentException - if parameter is null
      • getPostbackUri

        public java.lang.String getPostbackUri()
        Returns the postback URI of the mechanism.
        Specified by:
        getPostbackUri in interface IChallenge
        Returns:
        the postback URI of the mechanism
      • getState

        public java.lang.String getState()
        Returns the unique identifier of the mechanism request.
        Specified by:
        getState in interface IChallenge
        Returns:
        unique identifier of the mechanism request
      • setState

        public void setState(java.lang.String state)
        Set the unique identifier of the mechanism request.
        Specified by:
        setState in interface IChallenge
        Parameters:
        state - unique identifier to be set
        Throws:
        java.lang.IllegalArgumentException - if parameter is null
      • getMessagePrompt

        public java.lang.String getMessagePrompt()
        Returns the message to display in the alert when prompted.
        Specified by:
        getMessagePrompt in interface IChallenge
        Returns:
        the message to display in the alert
      • launchUI

        public void launchUI(android.app.Activity activity,
                             IChallengeCallbackHandleUserInput callback)
        This method launches an AlertDialog to prompt for a HMAC based one-time password.
        Specified by:
        launchUI in interface IChallenge
        Parameters:
        callback - the function delegate that is invoked with the user input
      • describeContents

        public int describeContents()
        Returns a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
        Specified by:
        describeContents in interface android.os.Parcelable
        Returns:
        bitmask indicating the set of special object types
        Since:
        1.2.2
      • writeToParcel

        public void writeToParcel(android.os.Parcel parcel,
                                  int i)
        Writes the object into a parcel.
        Specified by:
        writeToParcel in interface android.os.Parcelable
        Parameters:
        parcel - the parcel where the object is written into
        i - flags about how the object should be written
        Since:
        1.2.2