test_class.declarator: KDF_KEY_SIZE = 16
test_class.modifier: private static final
test_class.original_string: private static final int KDF_KEY_SIZE = 16;
test_class.type: int
test_class.var_name: KDF_KEY_SIZE
test_class.declarator: AES_KEY_SIZE = 16
test_class.modifier: private static final
test_class.original_string: private static final int AES_KEY_SIZE = 16;
test_class.type: int
test_class.var_name: AES_KEY_SIZE
test_class.file: java_src/src/test/java/com/google/crypto/tink/streamingaead/StreamingAeadFactoryTest.java
test_class.identifier: StreamingAeadFactoryTest
test_case.body: @Test
    public void testInvalidKeyMaterial() throws Exception {
      Key valid =
          TestUtil.createKey(
              TestUtil.createAesGcmHkdfStreamingKeyData(
                  Random.randBytes(KDF_KEY_SIZE), AES_KEY_SIZE, 128),
              42,
              KeyStatusType.ENABLED,
              OutputPrefixType.RAW);
      Key invalid =
          TestUtil.createKey(
              TestUtil.createAesSivKeyData(64), 43, KeyStatusType.ENABLED, OutputPrefixType.TINK);
  
      KeysetHandle keysetHandle = TestUtil.createKeysetHandle(TestUtil.createKeyset(valid, invalid));
      try {
        StreamingAeadFactory.getPrimitive(keysetHandle);
        fail("Expected GeneralSecurityException");
      } catch (GeneralSecurityException e) {
        assertExceptionContains(e, "com.google.crypto.tink.StreamingAead not supported");
      }
  
      // invalid as the primary key.
      keysetHandle = TestUtil.createKeysetHandle(TestUtil.createKeyset(invalid, valid));
      try {
        StreamingAeadFactory.getPrimitive(keysetHandle);
        fail("Expected GeneralSecurityException");
      } catch (GeneralSecurityException e) {
        assertExceptionContains(e, "com.google.crypto.tink.StreamingAead not supported");
      }
    }
test_case.class_method_signature: StreamingAeadFactoryTest.testInvalidKeyMaterial()
test_case.full_signature: @Test public void testInvalidKeyMaterial()
test_case.identifier: testInvalidKeyMaterial
test_case.invocations: createKey createAesGcmHkdfStreamingKeyData randBytes createKey createAesSivKeyData createKeysetHandle createKeyset getPrimitive fail assertExceptionContains createKeysetHandle createKeyset getPrimitive fail assertExceptionContains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvalidKeyMaterial()
focal_class.file: java_src/src/main/java/com/google/crypto/tink/streamingaead/StreamingAeadFactory.java
focal_class.identifier: StreamingAeadFactory
focal_class.class_method_signature: StreamingAeadFactory.getPrimitive(KeysetHandle keysetHandle)
focal_class.full_signature: public static StreamingAead getPrimitive(KeysetHandle keysetHandle)
focal_class.identifier: getPrimitive
focal_class.modifiers: public static
focal_class.parameters: (KeysetHandle keysetHandle)
focal_class.return: StreamingAead
focal_class.signature: StreamingAead getPrimitive(KeysetHandle keysetHandle)
focal_class.class_method_signature: StreamingAeadFactory.getPrimitive(
        KeysetHandle keysetHandle,
        final KeyManager<StreamingAead> keyManager)
focal_class.full_signature: public static StreamingAead getPrimitive(
        KeysetHandle keysetHandle,
        final KeyManager<StreamingAead> keyManager)
focal_class.identifier: getPrimitive
focal_class.modifiers: public static
focal_class.parameters: (
        KeysetHandle keysetHandle,
        final KeyManager<StreamingAead> keyManager)
focal_class.return: StreamingAead
focal_class.signature: StreamingAead getPrimitive(
        KeysetHandle keysetHandle,
        final KeyManager<StreamingAead> keyManager)
focal_method.body: public static StreamingAead getPrimitive(KeysetHandle keysetHandle)
        throws GeneralSecurityException {
      return getPrimitive(keysetHandle, /* keyManager= */ null);
    }
focal_method.class_method_signature: StreamingAeadFactory.getPrimitive(KeysetHandle keysetHandle)
focal_method.full_signature: public static StreamingAead getPrimitive(KeysetHandle keysetHandle)
focal_method.identifier: getPrimitive
focal_method.invocations: getPrimitive
focal_method.modifiers: public static
focal_method.parameters: (KeysetHandle keysetHandle)
focal_method.return: StreamingAead
focal_method.signature: StreamingAead getPrimitive(KeysetHandle keysetHandle)