@Test
  public void getPrimitive_decryptWithStream_works() throws Exception {
    AesGcmHkdfStreamingParams params =
        AesGcmHkdfStreamingParams.newBuilder()
            .setHkdfHashType(HashType.SHA512)
            .setDerivedKeySize(32)
            .setCiphertextSegmentSize(64)
            .build();
    AesGcmHkdfStreamingKey key =
        AesGcmHkdfStreamingKey.newBuilder()
            .setKeyValue(
                ByteString.copyFrom(
                    Hex.decode("abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd")))
            .setParams(params)
            .build();
    KeyData keyData =
        KeyData.newBuilder()
            .setKeyMaterialType(KeyMaterialType.SYMMETRIC)
            .setTypeUrl(TYPE_URL)
            .setValue(key.toByteString())
            .build();
    byte[] associatedData = Hex.decode("abcdef0123456789");
    byte[] ciphertext =
        Hex.decode(
            "28a051f98fe397ed70c7096c6dae34448b9fe0bcd702a061eb4d378149069217"
                + "719ea94ed90e881eb6f881dd3e41342ce894faab9dbfa76077d94f88b5897dfe"
                + "7f8dc971ecef7cdb28c25aa19fbc4be30e");
    InputStream ciphertextStream = new ByteArrayInputStream(ciphertext);

    StreamingAead streamingAead = Registry.getPrimitive(keyData, StreamingAead.class);
    InputStream plaintextStream =
        streamingAead.newDecryptingStream(ciphertextStream, associatedData);
    byte[] plaintext = new byte[2 * "plaintext".getBytes(UTF_8).length];
    int read = plaintextStream.read(plaintext);

    assertThat(read).isEqualTo("plaintext".getBytes(UTF_8).length);
    assertThat(Arrays.copyOf(plaintext, read)).isEqualTo("plaintext".getBytes(UTF_8));
  }
Type url that this manager supports.
java_src/src/test/java/com/google/crypto/tink/streamingaead/internal/LegacyAesGcmHkdfStreamingTestKeyManagerTest.java