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 testMultipleKeys() throws Exception {
      byte[] primaryKeyValue = Random.randBytes(KDF_KEY_SIZE);
      byte[] otherKeyValue = Random.randBytes(KDF_KEY_SIZE);
      byte[] anotherKeyValue = Random.randBytes(KDF_KEY_SIZE);
      int derivedKeySize = AES_KEY_SIZE;
  
      Key primaryKey = TestUtil.createKey(
          TestUtil.createAesGcmHkdfStreamingKeyData(
              primaryKeyValue, derivedKeySize, 512),
          42,
          KeyStatusType.ENABLED,
          OutputPrefixType.RAW);
      // Another key with a smaller segment size than the primary key
      Key otherKey = TestUtil.createKey(
          TestUtil.createAesCtrHmacStreamingKeyData(
              otherKeyValue, derivedKeySize, 256),
          43,
          KeyStatusType.ENABLED,
          OutputPrefixType.RAW);
      // Another key with a larger segment size than the primary key
      Key anotherKey = TestUtil.createKey(
          TestUtil.createAesGcmHkdfStreamingKeyData(
              anotherKeyValue, derivedKeySize, 1024),
          72,
          KeyStatusType.ENABLED,
          OutputPrefixType.RAW);
  
      KeysetHandle keysetHandle =
          TestUtil.createKeysetHandle(TestUtil.createKeyset(primaryKey, otherKey, anotherKey));
      StreamingAead streamingAead = StreamingAeadFactory.getPrimitive(keysetHandle);
  
      StreamingAead primaryAead = StreamingAeadFactory.getPrimitive(
          TestUtil.createKeysetHandle(TestUtil.createKeyset(primaryKey)));
      StreamingAead otherAead = StreamingAeadFactory.getPrimitive(
          TestUtil.createKeysetHandle(TestUtil.createKeyset(otherKey)));
      StreamingAead anotherAead = StreamingAeadFactory.getPrimitive(
          TestUtil.createKeysetHandle(TestUtil.createKeyset(anotherKey)));
  
      StreamingTestUtil.testEncryptionAndDecryption(streamingAead, streamingAead);
      StreamingTestUtil.testEncryptionAndDecryption(streamingAead, primaryAead);
      StreamingTestUtil.testEncryptionAndDecryption(primaryAead, streamingAead);
      StreamingTestUtil.testEncryptionAndDecryption(otherAead, streamingAead);
      StreamingTestUtil.testEncryptionAndDecryption(anotherAead, streamingAead);
      StreamingTestUtil.testEncryptionAndDecryption(primaryAead, primaryAead);
      StreamingTestUtil.testEncryptionAndDecryption(otherAead, otherAead);
      StreamingTestUtil.testEncryptionAndDecryption(anotherAead, anotherAead);
      try {
        StreamingTestUtil.testEncryptionAndDecryption(otherAead, primaryAead);
        fail("No matching key, should have thrown an exception");
      } catch (IOException expected) {
        assertExceptionContains(expected, "No matching key");
      }
      try {
        StreamingTestUtil.testEncryptionAndDecryption(anotherAead, primaryAead);
        fail("No matching key, should have thrown an exception");
      } catch (IOException expected) {
        assertExceptionContains(expected, "No matching key");
      }
    }
test_case.class_method_signature: StreamingAeadFactoryTest.testMultipleKeys()
test_case.full_signature: @Test public void testMultipleKeys()
test_case.identifier: testMultipleKeys
test_case.invocations: randBytes randBytes randBytes createKey createAesGcmHkdfStreamingKeyData createKey createAesCtrHmacStreamingKeyData createKey createAesGcmHkdfStreamingKeyData createKeysetHandle createKeyset getPrimitive getPrimitive createKeysetHandle createKeyset getPrimitive createKeysetHandle createKeyset getPrimitive createKeysetHandle createKeyset testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption testEncryptionAndDecryption fail assertExceptionContains testEncryptionAndDecryption fail assertExceptionContains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultipleKeys()
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)