@Test
  public void testGetPrimitive_aesGcm_shouldWork() throws Exception {
    // Skip test if in FIPS mode, as EAX is not supported in FIPS mode.
    Assume.assumeFalse(TinkFips.useOnlyFips());

    AesEaxKey aesEaxKey =
        (AesEaxKey) Registry.newKey(AesEaxKeyManager.aes128EaxTemplate().getProto());
    KeyData aesEaxKeyData = Registry.newKeyData(AesEaxKeyManager.aes128EaxTemplate().getProto());
    Aead aead = Registry.getPrimitive(aesEaxKeyData, Aead.class);

    assertThat(aesEaxKey.getKeyValue().size()).isEqualTo(16);
    assertThat(aesEaxKeyData.getTypeUrl()).isEqualTo(AeadConfig.AES_EAX_TYPE_URL);
    // This might break when we add native implementations.
    assertThat(aead.getClass()).isEqualTo(AesEaxJce.class);
  }
Returns the type URL that identifies the key type of keys managed by this KeyManager.
java_src/src/test/java/com/google/crypto/tink/RegistryTest.java