public enum HmacAlgorithm extends java.lang.Enum<HmacAlgorithm>
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.
|
public static final HmacAlgorithm SHA1
public static final HmacAlgorithm SHA256
public static final HmacAlgorithm SHA512
public static HmacAlgorithm[] values()
for (HmacAlgorithm c : HmacAlgorithm.values()) System.out.println(c);
public static HmacAlgorithm valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
toString
in class java.lang.Enum<HmacAlgorithm>
public static HmacAlgorithm getEnum(int index)
public static int getIndex(java.lang.String algorithm)
public static HmacAlgorithm getEnum(java.lang.String 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).
algorithm
- the name of the algorithm