aboutsummaryrefslogtreecommitdiff
path: root/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java')
-rw-r--r--java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java b/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
index 12a4e5c5d..dc1439dac 100644
--- a/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
+++ b/java_src/src/main/java/com/google/crypto/tink/prf/AesCmacPrfKeyManager.java
@@ -19,6 +19,8 @@ package com.google.crypto.tink.prf;
import com.google.crypto.tink.KeyTemplate;
import com.google.crypto.tink.Registry;
import com.google.crypto.tink.internal.KeyTypeManager;
+import com.google.crypto.tink.internal.MutablePrimitiveRegistry;
+import com.google.crypto.tink.internal.PrimitiveConstructor;
import com.google.crypto.tink.internal.PrimitiveFactory;
import com.google.crypto.tink.proto.AesCmacPrfKey;
import com.google.crypto.tink.proto.AesCmacPrfKeyFormat;
@@ -52,6 +54,10 @@ public final class AesCmacPrfKeyManager extends KeyTypeManager<AesCmacPrfKey> {
private static final int VERSION = 0;
private static final int KEY_SIZE_IN_BYTES = 32;
+ private static final PrimitiveConstructor<com.google.crypto.tink.prf.AesCmacPrfKey, Prf>
+ PRF_PRIMITIVE_CONSTRUCTOR =
+ PrimitiveConstructor.create(
+ PrfAesCmac::create, com.google.crypto.tink.prf.AesCmacPrfKey.class, Prf.class);
@Override
public String getKeyType() {
@@ -131,6 +137,8 @@ public final class AesCmacPrfKeyManager extends KeyTypeManager<AesCmacPrfKey> {
public static void register(boolean newKeyAllowed) throws GeneralSecurityException {
Registry.registerKeyManager(new AesCmacPrfKeyManager(), newKeyAllowed);
AesCmacPrfProtoSerialization.register();
+ MutablePrimitiveRegistry.globalInstance()
+ .registerPrimitiveConstructor(PRF_PRIMITIVE_CONSTRUCTOR);
}
/**