test_class.declarator: manager = new HmacPrfKeyManager()
test_class.modifier: private final
test_class.original_string: private final HmacPrfKeyManager manager = new HmacPrfKeyManager();
test_class.type: HmacPrfKeyManager
test_class.var_name: manager
test_class.declarator: factory =
        manager.keyFactory()
test_class.modifier: private final
test_class.original_string: private final KeyTypeManager.KeyFactory<HmacPrfKeyFormat, HmacPrfKey> factory =
        manager.keyFactory();
test_class.type: KeyTypeManager.KeyFactory<HmacPrfKeyFormat, HmacPrfKey>
test_class.var_name: factory
test_class.file: java_src/src/test/java/com/google/crypto/tink/prf/HmacPrfKeyManagerTest.java
test_class.identifier: HmacPrfKeyManagerTest
test_case.body: @Test
    public void validateKey_notValid_throws() throws Exception {
      HmacPrfKey validKey = factory.createKey(makeHmacPrfKeyFormat(16, HashType.SHA1));
      try {
        manager.validateKey(
            HmacPrfKey.newBuilder(validKey)
                .setKeyValue(ByteString.copyFrom(Random.randBytes(15)))
                .build());
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
      try {
        manager.validateKey(
            HmacPrfKey.newBuilder(validKey)
                .setParams(
                    HmacPrfParams.newBuilder(validKey.getParams())
                        .setHash(HashType.UNKNOWN_HASH)
                        .build())
                .build());
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
    }
test_case.class_method_signature: HmacPrfKeyManagerTest.validateKey_notValid_throws()
test_case.full_signature: @Test public void validateKey_notValid_throws()
test_case.identifier: validateKey_notValid_throws
test_case.invocations: createKey makeHmacPrfKeyFormat validateKey build setKeyValue newBuilder copyFrom randBytes fail validateKey build setParams newBuilder build setHash newBuilder getParams fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void validateKey_notValid_throws()
focal_class.declarator: MIN_KEY_SIZE_IN_BYTES = 16
focal_class.modifier: private static final
focal_class.original_string: private static final int MIN_KEY_SIZE_IN_BYTES = 16;
focal_class.type: int
focal_class.var_name: MIN_KEY_SIZE_IN_BYTES
focal_class.file: java_src/src/main/java/com/google/crypto/tink/prf/HmacPrfKeyManager.java
focal_class.identifier: HmacPrfKeyManager
focal_class.class_method_signature: HmacPrfKeyManager.HmacPrfKeyManager()
focal_class.full_signature: public  HmacPrfKeyManager()
focal_class.identifier: HmacPrfKeyManager
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  HmacPrfKeyManager()
focal_class.class_method_signature: HmacPrfKeyManager.getKeyType()
focal_class.full_signature: @Override public String getKeyType()
focal_class.identifier: getKeyType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getKeyType()
focal_class.class_method_signature: HmacPrfKeyManager.getVersion()
focal_class.full_signature: @Override public int getVersion()
focal_class.identifier: getVersion
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getVersion()
focal_class.class_method_signature: HmacPrfKeyManager.keyMaterialType()
focal_class.full_signature: @Override public KeyMaterialType keyMaterialType()
focal_class.identifier: keyMaterialType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: KeyMaterialType
focal_class.signature: KeyMaterialType keyMaterialType()
focal_class.class_method_signature: HmacPrfKeyManager.validateKey(HmacPrfKey key)
focal_class.full_signature: @Override public void validateKey(HmacPrfKey key)
focal_class.identifier: validateKey
focal_class.modifiers: @Override public
focal_class.parameters: (HmacPrfKey key)
focal_class.return: void
focal_class.signature: void validateKey(HmacPrfKey key)
focal_class.class_method_signature: HmacPrfKeyManager.parseKey(ByteString byteString)
focal_class.full_signature: @Override public HmacPrfKey parseKey(ByteString byteString)
focal_class.identifier: parseKey
focal_class.modifiers: @Override public
focal_class.parameters: (ByteString byteString)
focal_class.return: HmacPrfKey
focal_class.signature: HmacPrfKey parseKey(ByteString byteString)
focal_class.class_method_signature: HmacPrfKeyManager.validateParams(HmacPrfParams params)
focal_class.full_signature: private static void validateParams(HmacPrfParams params)
focal_class.identifier: validateParams
focal_class.modifiers: private static
focal_class.parameters: (HmacPrfParams params)
focal_class.return: void
focal_class.signature: void validateParams(HmacPrfParams params)
focal_class.class_method_signature: HmacPrfKeyManager.keyFactory()
focal_class.full_signature: @Override public KeyFactory<HmacPrfKeyFormat, HmacPrfKey> keyFactory()
focal_class.identifier: keyFactory
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: KeyFactory<HmacPrfKeyFormat, HmacPrfKey>
focal_class.signature: KeyFactory<HmacPrfKeyFormat, HmacPrfKey> keyFactory()
focal_class.class_method_signature: HmacPrfKeyManager.register(boolean newKeyAllowed)
focal_class.full_signature: public static void register(boolean newKeyAllowed)
focal_class.identifier: register
focal_class.modifiers: public static
focal_class.parameters: (boolean newKeyAllowed)
focal_class.return: void
focal_class.signature: void register(boolean newKeyAllowed)
focal_class.class_method_signature: HmacPrfKeyManager.hmacSha256Template()
focal_class.full_signature: public static final KeyTemplate hmacSha256Template()
focal_class.identifier: hmacSha256Template
focal_class.modifiers: public static final
focal_class.parameters: ()
focal_class.return: KeyTemplate
focal_class.signature: KeyTemplate hmacSha256Template()
focal_class.class_method_signature: HmacPrfKeyManager.hmacSha512Template()
focal_class.full_signature: public static final KeyTemplate hmacSha512Template()
focal_class.identifier: hmacSha512Template
focal_class.modifiers: public static final
focal_class.parameters: ()
focal_class.return: KeyTemplate
focal_class.signature: KeyTemplate hmacSha512Template()
focal_class.class_method_signature: HmacPrfKeyManager.createTemplate(int keySize, HashType hashType)
focal_class.full_signature: private static KeyTemplate createTemplate(int keySize, HashType hashType)
focal_class.identifier: createTemplate
focal_class.modifiers: private static
focal_class.parameters: (int keySize, HashType hashType)
focal_class.return: KeyTemplate
focal_class.signature: KeyTemplate createTemplate(int keySize, HashType hashType)
focal_class.superclass: extends KeyTypeManager<HmacPrfKey>
focal_method.body: @Override
    public void validateKey(HmacPrfKey key) throws GeneralSecurityException {
      Validators.validateVersion(key.getVersion(), getVersion());
      if (key.getKeyValue().size() < MIN_KEY_SIZE_IN_BYTES) {
        throw new GeneralSecurityException("key too short");
      }
      validateParams(key.getParams());
    }
focal_method.class_method_signature: HmacPrfKeyManager.validateKey(HmacPrfKey key)
focal_method.full_signature: @Override public void validateKey(HmacPrfKey key)
focal_method.identifier: validateKey
focal_method.invocations: validateVersion getVersion getVersion size getKeyValue validateParams getParams
focal_method.modifiers: @Override public
focal_method.parameters: (HmacPrfKey key)
focal_method.return: void
focal_method.signature: void validateKey(HmacPrfKey key)