private static KeysetHandle getKeysetHandleFromProtoKey(
      AesSivKey protoKey, OutputPrefixType outputPrefixType) throws GeneralSecurityException {
    KeyData keyData =
        KeyData.newBuilder()
            .setTypeUrl(TYPE_URL)
            .setValue(protoKey.toByteString())
            .setKeyMaterialType(KeyMaterialType.SYMMETRIC)
            .build();
    Keyset keyset =
        Keyset.newBuilder()
            .addKey(
                Keyset.Key.newBuilder()
                    .setKeyData(keyData)
                    .setStatus(KeyStatusType.ENABLED)
                    .setOutputPrefixType(outputPrefixType)
                    .setKeyId(KEY_ID)
                    .build())
            .setPrimaryKeyId(KEY_ID)
            .build();

    return TinkProtoKeysetFormat.parseKeyset(keyset.toByteArray(), InsecureSecretKeyAccess.get());
  }
This encrypts using the subtle Tink API, then decrypts using the custom key manager with a
keyset with a single key.
java_src/src/test/java/com/google/crypto/tink/daead/KeyManagerIntegrationTest.java