Package com.google.crypto.tink.mac
Class MacKey
- java.lang.Object
-
- com.google.crypto.tink.Key
-
- com.google.crypto.tink.mac.MacKey
-
- Direct Known Subclasses:
AesCmacKey,HmacKey
public abstract class MacKey extends Key
Represents functions to compute and verify a cryptographic MAC.
-
-
Constructor Summary
Constructors Constructor Description MacKey()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract BytesgetOutputPrefix()Returns aBytesinstance which is prefixed to every mac tag.abstract MacParametersgetParameters()Returns the parameters of this key.-
Methods inherited from class com.google.crypto.tink.Key
equalsKey, getIdRequirementOrNull
-
-
-
-
Method Detail
-
getOutputPrefix
public abstract Bytes getOutputPrefix()
Returns aBytesinstance which is prefixed to every mac tag.In order to make key rotation more efficient, Tink allows every Mac key to be prefixed with a sequence of bytes. When verifying a tag, only keys with matching prefix have to be tried.
Note that a priori, the output prefix may not be unique in a keyset (i.e., different keys in a keyset may have the same prefix (or, one prefix may be a prefix of the other). To avoid this, built in Tink keys use the convention that the prefix is either '0x00' or '0x01'. See the Tink keys for details.
-
getParameters
public abstract MacParameters getParameters()
Returns the parameters of this key.- Specified by:
getParametersin classKey
-
-