public final class HmacKeyManager extends KeyTypeManager<HmacKey>
HmacKey keys and produces new instances of PrfHmacJce.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Constructor and Description |
|---|
HmacKeyManager() |
| Modifier and Type | Method and Description |
|---|---|
TinkFipsUtil.AlgorithmFipsCompatibility |
fipsStatus()
Returns the FIPS compatibility of this KeyTypeManager.
|
String |
getKeyType()
Returns the type URL that identifies the key type of keys managed by this KeyManager.
|
int |
getVersion()
Returns the version number of this KeyManager.
|
static KeyTemplate |
hmacSha256HalfDigestTemplate() |
static KeyTemplate |
hmacSha256Template() |
static KeyTemplate |
hmacSha512HalfDigestTemplate() |
static KeyTemplate |
hmacSha512Template() |
KeyTypeManager.KeyFactory<HmacKeyFormat,HmacKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
HmacKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static void |
register(boolean newKeyAllowed) |
void |
validateKey(HmacKey key)
Checks if the given
keyProto is a valid key. |
firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<HmacKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<HmacKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<HmacKey>public void validateKey(HmacKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<HmacKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public HmacKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<HmacKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<HmacKeyFormat,HmacKey> keyFactory()
KeyTypeManagerKeyTypeManager.KeyFactory for this key type.
By default, this throws an UnsupportedOperationException. Hence, if an implementation does not support creating primitives, no implementation is required.
keyFactory in class KeyTypeManager<HmacKey>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static final KeyTemplate hmacSha256HalfDigestTemplate()
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
KeyTemplate.OutputPrefixType#TINK
public static final KeyTemplate hmacSha256Template()
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
KeyTemplate.OutputPrefixType#TINK
public static final KeyTemplate hmacSha512HalfDigestTemplate()
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
KeyTemplate.OutputPrefixType#TINK
public static final KeyTemplate hmacSha512Template()
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
KeyTemplate.OutputPrefixType#TINK
public TinkFipsUtil.AlgorithmFipsCompatibility fipsStatus()
KeyTypeManagerfipsStatus in class KeyTypeManager<HmacKey>