@Test
  public void getPrimitive_encryptDecryptDeterministically_works() throws Exception {
    AesSivKey key =
        AesSivKey.newBuilder()
            .setKeyValue(ByteString.copyFrom(Random.randBytes(64)))
            .setVersion(0)
            .build();
    KeyData keyData =
        KeyData.newBuilder()
            .setKeyMaterialType(KeyMaterialType.SYMMETRIC)
            .setTypeUrl(TYPE_URL)
            .setValue(key.toByteString())
            .build();

    DeterministicAead daead = Registry.getPrimitive(keyData, DeterministicAead.class);
    byte[] plaintext = Random.randBytes(20);
    byte[] associatedData = Random.randBytes(20);
    byte[] ciphertext = daead.encryptDeterministically(plaintext, associatedData);
    byte[] ciphertext2 = daead.encryptDeterministically(plaintext, associatedData);
    byte[] decrypted = daead.decryptDeterministically(ciphertext, associatedData);
    byte[] decrypted2 = daead.decryptDeterministically(ciphertext2, associatedData);

    assertArrayEquals(ciphertext, ciphertext2);
    assertArrayEquals(plaintext, decrypted);
    assertArrayEquals(plaintext, decrypted2);
  }
Type url that this manager supports.
java_src/src/test/java/com/google/crypto/tink/daead/internal/testing/LegacyAesSivTestKeyManagerTest.java