com.ibm.security.access.mobile.authorization

Class HotpGeneratorContext

    • Constructor Summary

      Constructors 
      Constructor and Description
      HotpGeneratorContext(java.lang.String secret, int counter)
      Returns a new HotpGeneratorContext object with the values secret and counter.
      HotpGeneratorContext(java.lang.String secret, int digits, HmacAlgorithm algorithm, int counter)
      Returns a new HotpGeneratorContext object with the values secret, digits, algorithm and counter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String create()
      Returns an one-time password
      • Methods inherited from class java.lang.Object

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

      • HotpGeneratorContext

        public HotpGeneratorContext(java.lang.String secret,
                                    int digits,
                                    HmacAlgorithm algorithm,
                                    int counter)
        Returns a new HotpGeneratorContext object with the values secret, digits, algorithm and counter.
        Parameters:
        secret - the static symmetric key, null throws IllegalArgumentException
        digits - the required length of the one-time password, other values than 6 and 8 throw IllegalArgumentException
        algorithm - the algorithm that has to be used HmacAlgorithm
        counter - the initial counter for the calculation, has to be ≥ 0
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments is null or out of boundaries
      • HotpGeneratorContext

        public HotpGeneratorContext(java.lang.String secret,
                                    int counter)
        Returns a new HotpGeneratorContext object with the values secret and counter.

        The default value is used for the length of the one-time password (6) and the algorithm (HmacAlgorithm.SHA1).

        Parameters:
        secret - the static symmetric key, null throws IllegalArgumentException
        counter - the initial counter for the calculation, has to be ≥ 0
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments is null or out of boundaries
    • Method Detail

      • create

        public java.lang.String create()
        Returns an one-time password
        Returns:
        a String of the one-time password or null