@Test
  public void testGetPublicKeyData_shouldWork() throws Exception {
    // Skip test if in FIPS mode, as no provider available to instantiate.
    Assume.assumeFalse(TinkFips.useOnlyFips());

    KeyData privateKeyData = Registry.newKeyData(SignatureKeyTemplates.ECDSA_P256);
    KeyData publicKeyData = Registry.getPublicKeyData(privateKeyData.getTypeUrl(),
        privateKeyData.getValue());
    PublicKeyVerify verifier = Registry.getPrimitive(publicKeyData, PublicKeyVerify.class);
    PublicKeySign signer = Registry.getPrimitive(privateKeyData, PublicKeySign.class);
    byte[] message = "Nice test message".getBytes(UTF_8);
    verifier.verify(signer.sign(message), message);
  }
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