| Constructor and Description |
|---|
PrfMac(Prf wrappedPrf,
int tagSize)
Wrap
wrappedPrf in a Mac primitive with the specified tagSize |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
computeMac(byte[] data)
Computes message authentication code (MAC) for
data. |
static Mac |
create(AesCmacKey key)
Creates an object implementing the
Mac interface using an AesCmac underneath. |
static Mac |
create(HmacKey key)
Creates an object implementing the
Mac interface using an Hmac underneath. |
void |
verifyMac(byte[] mac,
byte[] data)
Verifies whether
mac is a correct authentication code (MAC) for data. |
public PrfMac(Prf wrappedPrf, int tagSize) throws GeneralSecurityException
wrappedPrf in a Mac primitive with the specified tagSizeGeneralSecurityExceptionpublic static Mac create(AesCmacKey key) throws GeneralSecurityException
Mac interface using an AesCmac underneath.GeneralSecurityExceptionpublic static Mac create(HmacKey key) throws GeneralSecurityException
Mac interface using an Hmac underneath.GeneralSecurityExceptionpublic byte[] computeMac(byte[] data)
throws GeneralSecurityException
Macdata.computeMac in interface MacGeneralSecurityExceptionpublic void verifyMac(byte[] mac,
byte[] data)
throws GeneralSecurityException
Macmac is a correct authentication code (MAC) for data.verifyMac in interface MacGeneralSecurityException - if mac is not a correct MAC for data