Class LegacyFullMac
- java.lang.Object
-
- com.google.crypto.tink.mac.internal.LegacyFullMac
-
- All Implemented Interfaces:
Mac
public final class LegacyFullMac extends java.lang.Object implements Mac
Takes an arbitrary raw Mac and makes it a full primitive. This is a class that helps us transition onto the new Keys and Configurations interface, by bringing potential user-defined primitives to a common denominator with our primitives over which we have control.
-
-
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(LegacyProtoKey key)This method covers the cases where users created their own mac/key classes.voidverifyMac(byte[] mac, byte[] data)Verifies whethermacis a correct authentication code (MAC) fordata.
-
-
-
Method Detail
-
create
public static Mac create(LegacyProtoKey key) throws java.security.GeneralSecurityException
This method covers the cases where users created their own mac/key classes.- 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.
-
-