test_class.file: java_src/src/test/java/com/google/crypto/tink/mac/AesCmacKeyManagerTest.java
test_class.identifier: AesCmacKeyManagerTest
test_case.body: @Test
    public void validateKeyFormat_notValid_throws() throws Exception {
      AesCmacKeyManager manager = new AesCmacKeyManager();
      try {
        manager.keyFactory().validateKeyFormat(makeAesCmacKeyFormat(32, 9));
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
      try {
        manager.keyFactory().validateKeyFormat(makeAesCmacKeyFormat(32, 17));
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
      try {
        manager.keyFactory().validateKeyFormat(makeAesCmacKeyFormat(32, 32));
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
      try {
        manager.keyFactory().validateKeyFormat(makeAesCmacKeyFormat(16, 16));
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
      try {
        manager.keyFactory().validateKeyFormat(makeAesCmacKeyFormat(64, 16));
        fail();
      } catch (GeneralSecurityException e) {
        // expected
      }
    }
test_case.class_method_signature: AesCmacKeyManagerTest.validateKeyFormat_notValid_throws()
test_case.full_signature: @Test public void validateKeyFormat_notValid_throws()
test_case.identifier: validateKeyFormat_notValid_throws
test_case.invocations: validateKeyFormat keyFactory makeAesCmacKeyFormat fail validateKeyFormat keyFactory makeAesCmacKeyFormat fail validateKeyFormat keyFactory makeAesCmacKeyFormat fail validateKeyFormat keyFactory makeAesCmacKeyFormat fail validateKeyFormat keyFactory makeAesCmacKeyFormat fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void validateKeyFormat_notValid_throws()
focal_class.declarator: VERSION = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int VERSION = 0;
focal_class.type: int
focal_class.var_name: VERSION
focal_class.declarator: KEY_SIZE_IN_BYTES = 32
focal_class.modifier: private static final
focal_class.original_string: private static final int KEY_SIZE_IN_BYTES = 32;
focal_class.type: int
focal_class.var_name: KEY_SIZE_IN_BYTES
focal_class.declarator: MIN_TAG_SIZE_IN_BYTES = 10
focal_class.modifier: private static final
focal_class.original_string: private static final int MIN_TAG_SIZE_IN_BYTES = 10;
focal_class.type: int
focal_class.var_name: MIN_TAG_SIZE_IN_BYTES
focal_class.declarator: MAX_TAG_SIZE_IN_BYTES = 16
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_TAG_SIZE_IN_BYTES = 16;
focal_class.type: int
focal_class.var_name: MAX_TAG_SIZE_IN_BYTES
focal_class.file: java_src/src/main/java/com/google/crypto/tink/mac/AesCmacKeyManager.java
focal_class.identifier: AesCmacKeyManager
focal_class.class_method_signature: AesCmacKeyManager.AesCmacKeyManager()
focal_class.full_signature:   AesCmacKeyManager()
focal_class.identifier: AesCmacKeyManager
focal_class.parameters: ()
focal_class.signature:  AesCmacKeyManager()
focal_class.class_method_signature: AesCmacKeyManager.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: AesCmacKeyManager.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: AesCmacKeyManager.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: AesCmacKeyManager.validateKey(AesCmacKey key)
focal_class.full_signature: @Override public void validateKey(AesCmacKey key)
focal_class.identifier: validateKey
focal_class.modifiers: @Override public
focal_class.parameters: (AesCmacKey key)
focal_class.return: void
focal_class.signature: void validateKey(AesCmacKey key)
focal_class.class_method_signature: AesCmacKeyManager.parseKey(ByteString byteString)
focal_class.full_signature: @Override public AesCmacKey parseKey(ByteString byteString)
focal_class.identifier: parseKey
focal_class.modifiers: @Override public
focal_class.parameters: (ByteString byteString)
focal_class.return: AesCmacKey
focal_class.signature: AesCmacKey parseKey(ByteString byteString)
focal_class.class_method_signature: AesCmacKeyManager.validateParams(AesCmacParams params)
focal_class.full_signature: private static void validateParams(AesCmacParams params)
focal_class.identifier: validateParams
focal_class.modifiers: private static
focal_class.parameters: (AesCmacParams params)
focal_class.return: void
focal_class.signature: void validateParams(AesCmacParams params)
focal_class.class_method_signature: AesCmacKeyManager.validateSize(int size)
focal_class.full_signature: private static void validateSize(int size)
focal_class.identifier: validateSize
focal_class.modifiers: private static
focal_class.parameters: (int size)
focal_class.return: void
focal_class.signature: void validateSize(int size)
focal_class.class_method_signature: AesCmacKeyManager.keyFactory()
focal_class.full_signature: @Override public KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory()
focal_class.identifier: keyFactory
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: KeyFactory<AesCmacKeyFormat, AesCmacKey>
focal_class.signature: KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory()
focal_class.class_method_signature: AesCmacKeyManager.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: AesCmacKeyManager.aes256CmacTemplate()
focal_class.full_signature: public static final KeyTemplate aes256CmacTemplate()
focal_class.identifier: aes256CmacTemplate
focal_class.modifiers: public static final
focal_class.parameters: ()
focal_class.return: KeyTemplate
focal_class.signature: KeyTemplate aes256CmacTemplate()
focal_class.class_method_signature: AesCmacKeyManager.rawAes256CmacTemplate()
focal_class.full_signature: public static final KeyTemplate rawAes256CmacTemplate()
focal_class.identifier: rawAes256CmacTemplate
focal_class.modifiers: public static final
focal_class.parameters: ()
focal_class.return: KeyTemplate
focal_class.signature: KeyTemplate rawAes256CmacTemplate()
focal_class.superclass: extends KeyTypeManager<AesCmacKey>
focal_method.body: @Override
    public KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory() {
      return new KeyFactory<AesCmacKeyFormat, AesCmacKey>(AesCmacKeyFormat.class) {
        @Override
        public void validateKeyFormat(AesCmacKeyFormat format) throws GeneralSecurityException {
          validateParams(format.getParams());
          validateSize(format.getKeySize());
        }
  
        @Override
        public AesCmacKeyFormat parseKeyFormat(ByteString byteString)
            throws InvalidProtocolBufferException {
          return AesCmacKeyFormat.parseFrom(byteString, ExtensionRegistryLite.getEmptyRegistry());
        }
  
        @Override
        public AesCmacKey createKey(AesCmacKeyFormat format) throws GeneralSecurityException {
          return AesCmacKey.newBuilder()
              .setVersion(VERSION)
              .setKeyValue(ByteString.copyFrom(Random.randBytes(format.getKeySize())))
              .setParams(format.getParams())
              .build();
        }
      };
    }
focal_method.class_method_signature: AesCmacKeyManager.keyFactory()
focal_method.full_signature: @Override public KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory()
focal_method.identifier: keyFactory
focal_method.invocations: validateParams getParams validateSize getKeySize parseFrom getEmptyRegistry build setParams setKeyValue setVersion newBuilder copyFrom randBytes getKeySize getParams
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: KeyFactory<AesCmacKeyFormat, AesCmacKey>
focal_method.signature: KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory()