@Theory
  public void testComputeCustom_verifyBuiltIn_works(
      @FromDataPoints("allOutputPrefixTypes") OutputPrefixType outputPrefixType) throws Exception {
    Ed25519PublicKey protoPublicKey =
        Ed25519PublicKey.newBuilder()
            .setVersion(0)
            .setKeyValue(ByteString.copyFrom(publicKeyByteArray))
            .build();
    Ed25519PrivateKey protoPrivateKey =
        Ed25519PrivateKey.newBuilder()
            .setVersion(0)
            .setPublicKey(protoPublicKey)
            .setKeyValue(ByteString.copyFrom(privateKeyByteArray))
            .build();
    KeyData keyData =
        KeyData.newBuilder()
            .setTypeUrl(PRIVATE_TYPE_URL)
            .setValue(protoPrivateKey.toByteString())
            .setKeyMaterialType(KeyMaterialType.ASYMMETRIC_PRIVATE)
            .build();
    Keyset keyset =
        Keyset.newBuilder()
            .addKey(
                Keyset.Key.newBuilder()
                    .setKeyData(keyData)
                    .setStatus(KeyStatusType.ENABLED)
                    .setOutputPrefixType(outputPrefixType)
                    .setKeyId(0x23456789)
                    .build())
            .setPrimaryKeyId(0x23456789)
            .build();

    KeysetHandle handle =
        TinkProtoKeysetFormat.parseKeyset(keyset.toByteArray(), InsecureSecretKeyAccess.get());
    PublicKeySign customSigner = handle.getPrimitive(PublicKeySign.class);

    byte[] message = new byte[] {1, 2, 3};
    byte[] signature = customSigner.sign(message);

    @Nullable Integer idRequirement = outputPrefixType == OutputPrefixType.RAW ? null : 0x23456789;
    PublicKeyVerify tinkVerifier =
        Ed25519Verify.create(
            com.google.crypto.tink.signature.Ed25519PublicKey.create(
                variantForOutputPrefix(outputPrefixType),
                Bytes.copyFrom(publicKeyByteArray),
                idRequirement));

    tinkVerifier.verify(signature, message);
  }
This test computes the signature using a keyset with one key, with the custom key manager. It
then verifies the Signature using normal Tink subtle Ed25519Verify.
java_src/src/test/java/com/google/crypto/tink/signature/KeyManagerIntegrationTest.java