public enum HMACSigningAlgorithm extends Enum<HMACSigningAlgorithm> implements SecurityAlgorithm, SigningAlgorithm
| Enum Constant and Description |
|---|
HMAC_MD5 |
HMAC_SHA_1 |
HMAC_SHA_256 |
| Modifier and Type | Method and Description |
|---|---|
Key |
generateKey(byte[] secret) |
String |
getAlgorithmName() |
byte[] |
sign(Key key,
byte[] data) |
static HMACSigningAlgorithm |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HMACSigningAlgorithm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
boolean |
verify(Key key,
String[] parts,
boolean urlSafe) |
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfverifypublic static final HMACSigningAlgorithm HMAC_MD5
public static final HMACSigningAlgorithm HMAC_SHA_1
public static final HMACSigningAlgorithm HMAC_SHA_256
public static HMACSigningAlgorithm[] values()
for (HMACSigningAlgorithm c : HMACSigningAlgorithm.values()) System.out.println(c);
public static HMACSigningAlgorithm valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getAlgorithmName()
getAlgorithmName in interface SecurityAlgorithmpublic Key generateKey(byte[] secret)
public byte[] sign(Key key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException
sign in interface SigningAlgorithmNoSuchAlgorithmExceptionInvalidKeyExceptionpublic boolean verify(Key key, String[] parts, boolean urlSafe) throws IOException, NoSuchAlgorithmException, InvalidKeyException
verify in interface SigningAlgorithmIOExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionCopyright © 2020. All rights reserved.