com.ibm.security.access.mobile.authorization

Enum HmacAlgorithm

  • java.lang.Object
    • java.lang.Enum<HmacAlgorithm>
      • com.ibm.security.access.mobile.authorization.HmacAlgorithm
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<HmacAlgorithm>


    public enum HmacAlgorithm
    extends java.lang.Enum<HmacAlgorithm>
    The enumerated type that provides access to a number of HMAC algorithms.
    Since:
    1.0.0
    Version:
    1.2.8
    • Enum Constant Summary

      Enum Constants 
      Enum Constant and Description
      SHA1 
      SHA256 
      SHA512 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static HmacAlgorithm getEnum(int index) 
      static HmacAlgorithm getEnum(java.lang.String algorithm)
      Returns the corresponding enum for the algorithm.
      static int getIndex(java.lang.String algorithm) 
      java.lang.String toString() 
      static HmacAlgorithm valueOf(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static HmacAlgorithm[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • values

        public static HmacAlgorithm[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (HmacAlgorithm c : HmacAlgorithm.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static HmacAlgorithm valueOf(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<HmacAlgorithm>
      • getIndex

        public static int getIndex(java.lang.String algorithm)
      • getEnum

        public static HmacAlgorithm getEnum(java.lang.String algorithm)
        Returns the corresponding enum for the algorithm.

        Accepts both "SHAx" and "HmacSHAx". The latter is required by Java itself (https://docs.oracle.com/javase/7/docs/api/javax/crypto/Mac.html), whereas the first one support Google's Key Uri Format (https://github.com/google/google-authenticator/wiki/Key-Uri-Format#algorithm).

        Parameters:
        algorithm - the name of the algorithm
        Returns:
        the enum representation or null if there is no match