public final class HmacPrfKeyManager extends KeyTypeManager<HmacPrfKey>
HmacPrfKey keys and produces new instances of PrfHmacJce.KeyTypeManager.KeyFactory<KeyFormatProtoT extends com.google.protobuf.MessageLite,KeyProtoT extends com.google.protobuf.MessageLite>| Constructor and Description |
|---|
HmacPrfKeyManager() |
| 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 |
hmacSha256Template()
Returns a
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
Key size: 32 bytes
Hash function: SHA256
Prefix type: KeyTemplate.OutputPrefixType#RAW
|
static KeyTemplate |
hmacSha512Template()
Returns a
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
Key size: 64 bytes
Hash function: SHA512
Prefix type: KeyTemplate.OutputPrefixType#RAW
|
KeyTypeManager.KeyFactory<HmacPrfKeyFormat,HmacPrfKey> |
keyFactory()
Returns the
KeyTypeManager.KeyFactory for this key type. |
KeyData.KeyMaterialType |
keyMaterialType()
Returns the
KeyData.KeyMaterialType for this proto. |
HmacPrfKey |
parseKey(com.google.protobuf.ByteString byteString)
Parses a serialized key proto.
|
static void |
register(boolean newKeyAllowed) |
void |
validateKey(HmacPrfKey key)
Checks if the given
keyProto is a valid key. |
firstSupportedPrimitiveClass, getKeyClass, getPrimitive, supportedPrimitivespublic String getKeyType()
KeyTypeManagergetKeyType in class KeyTypeManager<HmacPrfKey>public int getVersion()
KeyTypeManagergetVersion in class KeyTypeManager<HmacPrfKey>public KeyData.KeyMaterialType keyMaterialType()
KeyTypeManagerKeyData.KeyMaterialType for this proto.keyMaterialType in class KeyTypeManager<HmacPrfKey>public void validateKey(HmacPrfKey key) throws GeneralSecurityException
KeyTypeManagerkeyProto is a valid key.validateKey in class KeyTypeManager<HmacPrfKey>GeneralSecurityException - if the passed keyProto is not valid in any way.public HmacPrfKey parseKey(com.google.protobuf.ByteString byteString) throws com.google.protobuf.InvalidProtocolBufferException
KeyTypeManagerImplement as return KeyProtoT.parseFrom(byteString);.
parseKey in class KeyTypeManager<HmacPrfKey>com.google.protobuf.InvalidProtocolBufferExceptionpublic KeyTypeManager.KeyFactory<HmacPrfKeyFormat,HmacPrfKey> 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<HmacPrfKey>public static void register(boolean newKeyAllowed)
throws GeneralSecurityException
GeneralSecurityExceptionpublic TinkFipsUtil.AlgorithmFipsCompatibility fipsStatus()
KeyTypeManagerfipsStatus in class KeyTypeManager<HmacPrfKey>public static final KeyTemplate hmacSha256Template()
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
KeyTemplate.OutputPrefixType#RAW
public static final KeyTemplate hmacSha512Template()
KeyTemplate that generates new instances of HMAC keys with the following
parameters:
KeyTemplate.OutputPrefixType#RAW