Called by the holder to the verifier to verify the presentation with the verifier.
rpc PresentVerifiableCredential
PresentVerifiableCredential
vc_api.v1.PresentVerifiableCredential
vc_api.v1.PresentVerifiableCredential
Called by the holder to the verifier to verify the presentation with the verifier.
requests PresentVerifiableCredentialRequest
PresentVerifiableCredentialRequest
vc_api.v1.PresentVerifiableCredentialRequest
vc_api.v1.PresentVerifiableCredentialRequest
Field | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
presentation | string | The presentation to be verified. | |||||||||||||||
nonce | string | Value used for the challenge. | |||||||||||||||
signature | bytes | Signed value of the challenge by the wallet. | |||||||||||||||
did | string | W3C Decentralized Identifier (DID) of the wallet. | |||||||||||||||
credential_type | CredentialType enum |
|
resp, _ := credentialAdapterService.PresentVerifiableCredential(ctx, &v1.PresentVerifiableCredentialRequest{
Did: "did:method-name:zDIDMultibase58Encoded",
Nonce: "NonceLengthVariesByAlgo",
Presentation: "PRESENTATION",
Signature: []byte{72,129,141,1,53,17,19,16,88,76,68},
CredentialType: []v1.CredentialType{
v1.CredentialType_CREDENTIAL_TYPE_UNSPECIFIED,
v1.CredentialType_CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD,
},
})
fmt.Println(resp)
const presentverifiablecredentialrequest = new PresentVerifiableCredentialRequest();
presentverifiablecredentialrequest.setDid("did:method-name:zDIDMultibase58Encoded");
presentverifiablecredentialrequest.setNonce("NonceLengthVariesByAlgo");
presentverifiablecredentialrequest.setPresentation("PRESENTATION");
presentverifiablecredentialrequest.setSignature(Uint8Array.from([72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68]));
presentverifiablecredentialrequest.setCredentialTypeList([CredentialType.CREDENTIAL_TYPE_BANK_CARD, CredentialType.CREDENTIAL_TYPE_BANK_CARD]);
service.presentVerifiableCredential(presentverifiablecredentialrequest, (err, value:PresentVerifiableCredentialResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using Google.Protobuf;
using System.Text;
using VcApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("vc.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new CredentialAdapterService.CredentialAdapterServiceClient(channel);
var headers = new Metadata();
var presentVerifiableCredentialRequest = new PresentVerifiableCredentialRequest{
Did = "did:method-name:zDIDMultibase58Encoded",
Nonce = "NonceLengthVariesByAlgo",
Presentation = "PRESENTATION",
Signature = ByteString.CopyFrom(new byte[]{72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68}),
CredentialType = {CredentialType.Credential_type_unspecified, CredentialType.Credential_type_permanent_resident_card},
};
var reply = client.PresentVerifiableCredential(presentVerifiableCredentialRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import vc_api.v1.CredentialAdapterServiceGrpc;
import vc_api.v1.Vc.CredentialType;
import vc_api.v1.Vc.PresentVerifiableCredentialRequest;
import vc_api.v1.Vc.PresentVerifiableCredentialResponse;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
CredentialAdapterServiceGrpc.CredentialAdapterServiceBlockingStub blockStub =
CredentialAdapterServiceGrpc.newBlockingStub(channel);
PresentVerifiableCredentialRequest req_PresentVerifiableCredentialRequest =
PresentVerifiableCredentialRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.setNonce("NonceLengthVariesByAlgo")
.setPresentation("PRESENTATION")
.setSignature(com.google.protobuf.ByteString.copyFrom(new byte[]{72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68}))
.addCredentialType(CredentialType.CREDENTIAL_TYPE_UNSPECIFIED)
.addCredentialType(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
.build();
PresentVerifiableCredentialResponse resp = blockStub.presentVerifiableCredential(req_PresentVerifiableCredentialRequest);
System.out.println(resp);
channel.shutdown();
}
}
const presentverifiablecredentialrequest = new PresentVerifiableCredentialRequest();
presentverifiablecredentialrequest.setDid("did:method-name:zDIDMultibase58Encoded");
presentverifiablecredentialrequest.setNonce("NonceLengthVariesByAlgo");
presentverifiablecredentialrequest.setPresentation("PRESENTATION");
presentverifiablecredentialrequest.setSignature(Uint8Array.from([72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68]));
presentverifiablecredentialrequest.setCredentialTypeList([CredentialType.CREDENTIAL_TYPE_UNSPECIFIED, CredentialType.CREDENTIAL_TYPE_BANK_ACCOUNT]);
service.presentVerifiableCredential(presentverifiablecredentialrequest, (err, value) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::vc_api::v1::credential_adapter_service_client::CredentialAdapterServiceClient;
use grpc-sdks::vc_api::v1::CredentialType;
use grpc-sdks::vc_api::v1::PresentVerifiableCredentialRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("vc.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = CredentialAdapterServiceClient::new(channel);
let request = tonic::Request::new(
PresentVerifiableCredentialRequest{
credential_type: Vec::from([CredentialType::CredentialTypeUnspecified as i32, CredentialType::CredentialTypePermanentResidentCard as i32]),
did: String::from("did:method-name:zDIDMultibase58Encoded"),
nonce: String::from("NonceLengthVariesByAlgo"),
presentation: String::from("PRESENTATION"),
signature: Vec::from([72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68])
});
// sending request and waiting for response
let response = client.present_verifiable_credential(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import vc_api.v1.CredentialAdapterServiceGrpc
import vc_api.v1.Vc.CredentialType
import vc_api.v1.Vc.PresentVerifiableCredentialRequest
import vc_api.v1.Vc.PresentVerifiableCredentialResponse
fun main() {
val channel = ManagedChannelBuilder
.forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = CredentialAdapterServiceGrpc.newBlockingStub(channel)
val req_PresentVerifiableCredentialRequest = PresentVerifiableCredentialRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.setNonce("NonceLengthVariesByAlgo")
.setPresentation("PRESENTATION")
.setSignature(com.google.protobuf.ByteString.copyFrom(byteArrayOf(72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68)))
.addCredentialType(CredentialType.CREDENTIAL_TYPE_UNSPECIFIED)
.addCredentialType(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
.build()
val resp = blockStub.presentVerifiableCredential(req_PresentVerifiableCredentialRequest)
println(resp)
channel.shutdown()
}
returns PresentVerifiableCredentialResponse
PresentVerifiableCredentialResponse
vc_api.v1.PresentVerifiableCredentialResponse
vc_api.v1.PresentVerifiableCredentialResponse
{}