| Constructor and Description |
|---|
HMAC() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
compute(SecretKey secretKey,
byte[] message,
Provider provider)
Computes a Hash-based Message Authentication Code (HMAC) for the
specified secret key and message.
|
static byte[] |
compute(String alg,
byte[] secret,
byte[] message,
Provider provider)
Computes a Hash-based Message Authentication Code (HMAC) for the
specified secret and message.
|
static Mac |
getInitMac(SecretKey secretKey,
Provider provider) |
public HMAC()
public static Mac getInitMac(SecretKey secretKey, Provider provider) throws JOSEException
JOSEExceptionpublic static byte[] compute(String alg, byte[] secret, byte[] message, Provider provider) throws JOSEException
alg - The Java Cryptography Architecture (JCA) HMAC
algorithm name. Must not be null.secret - The secret. Must not be null.message - The message. Must not be null.provider - The JCA provider, or null to use the default
one.JOSEException - If the algorithm is not supported or the
MAC secret key is invalid.public static byte[] compute(SecretKey secretKey, byte[] message, Provider provider) throws JOSEException
secretKey - The secret key, with the appropriate HMAC
algorithm. Must not be null.message - The message. Must not be null.provider - The JCA provider, or null to use the
default one.JOSEException - If the algorithm is not supported or the MAC
secret key is invalid.Copyright © 2019 Connect2id Ltd.. All rights reserved.