Package com.google.crypto.tink.subtle
Class PrfMac
- java.lang.Object
-
- com.google.crypto.tink.subtle.PrfMac
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]computeMac(byte[] data)Computes message authentication code (MAC) fordata.static Maccreate(AesCmacKey key)Creates an object implementing theMacinterface using an AesCmac underneath.static Maccreate(HmacKey key)Creates an object implementing theMacinterface using an Hmac underneath.voidverifyMac(byte[] mac, byte[] data)Verifies whethermacis a correct authentication code (MAC) fordata.
-
-
-
Constructor Detail
-
PrfMac
public PrfMac(Prf wrappedPrf, int tagSize) throws java.security.GeneralSecurityException
WrapwrappedPrfin a Mac primitive with the specifiedtagSize- Throws:
java.security.GeneralSecurityException
-
-
Method Detail
-
create
public static Mac create(AesCmacKey key) throws java.security.GeneralSecurityException
Creates an object implementing theMacinterface using an AesCmac underneath.- Throws:
java.security.GeneralSecurityException
-
create
public static Mac create(HmacKey key) throws java.security.GeneralSecurityException
Creates an object implementing theMacinterface using an Hmac underneath.- Throws:
java.security.GeneralSecurityException
-
computeMac
public byte[] computeMac(byte[] data) throws java.security.GeneralSecurityExceptionDescription copied from interface:MacComputes message authentication code (MAC) fordata.- Specified by:
computeMacin interfaceMac- Returns:
- MAC value
- Throws:
java.security.GeneralSecurityException
-
verifyMac
public void verifyMac(byte[] mac, byte[] data) throws java.security.GeneralSecurityExceptionDescription copied from interface:MacVerifies whethermacis a correct authentication code (MAC) fordata.
-
-