Called by the holder to the verifier to initiate the challenge needed to verify the presentation with the verifier.
rpc CreatePresentationChallenge
CreatePresentationChallenge
vc_api.v1.CreatePresentationChallenge
vc_api.v1.CreatePresentationChallenge
Called by the holder to the verifier to initiate the challenge needed to verify the presentation with the verifier.
requests CreatePresentationChallengeRequest
CreatePresentationChallengeRequest
vc_api.v1.CreatePresentationChallengeRequest
vc_api.v1.CreatePresentationChallengeRequest
Field | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
credential_types | CredentialType
|
|
resp, _ := credentialAdapterService.CreatePresentationChallenge(ctx, &v1.CreatePresentationChallengeRequest{
CredentialTypes: []v1.CredentialType{
v1.CredentialType_CREDENTIAL_TYPE_UNSPECIFIED,
v1.CredentialType_CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD,
},
})
fmt.Println(resp)
const createpresentationchallengerequest = new CreatePresentationChallengeRequest();
createpresentationchallengerequest.setCredentialTypesList([CredentialType.CREDENTIAL_TYPE_BANK_ACCOUNT, CredentialType.CREDENTIAL_TYPE_BANK_ACCOUNT]);
service.createPresentationChallenge(createpresentationchallengerequest, (err, value:CreatePresentationChallengeResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
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 createPresentationChallengeRequest = new CreatePresentationChallengeRequest{
CredentialTypes = {CredentialType.Credential_type_unspecified, CredentialType.Credential_type_permanent_resident_card},
};
var reply = client.CreatePresentationChallenge(createPresentationChallengeRequest, 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.CreatePresentationChallengeRequest;
import vc_api.v1.Vc.CreatePresentationChallengeResponse;
import vc_api.v1.Vc.CredentialType;
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);
CreatePresentationChallengeRequest req_CreatePresentationChallengeRequest =
CreatePresentationChallengeRequest.newBuilder()
.addCredentialTypes(CredentialType.CREDENTIAL_TYPE_UNSPECIFIED)
.addCredentialTypes(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
.build();
CreatePresentationChallengeResponse resp = blockStub.createPresentationChallenge(req_CreatePresentationChallengeRequest);
System.out.println(resp);
channel.shutdown();
}
}
const createpresentationchallengerequest = new CreatePresentationChallengeRequest();
createpresentationchallengerequest.setCredentialTypesList([CredentialType.CREDENTIAL_TYPE_BANK_ACCOUNT, CredentialType.CREDENTIAL_TYPE_BANK_ACCOUNT]);
service.createPresentationChallenge(createpresentationchallengerequest, (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::CreatePresentationChallengeRequest;
#[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(
CreatePresentationChallengeRequest{
credential_types: Vec::from([CredentialType::CredentialTypeUnspecified as i32, CredentialType::CredentialTypePermanentResidentCard as i32])
});
// sending request and waiting for response
let response = client.create_presentation_challenge(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import vc_api.v1.CredentialAdapterServiceGrpc
import vc_api.v1.Vc.CreatePresentationChallengeRequest
import vc_api.v1.Vc.CreatePresentationChallengeResponse
import vc_api.v1.Vc.CredentialType
fun main() {
val channel = ManagedChannelBuilder
.forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = CredentialAdapterServiceGrpc.newBlockingStub(channel)
val req_CreatePresentationChallengeRequest = CreatePresentationChallengeRequest.newBuilder()
.addCredentialTypes(CredentialType.CREDENTIAL_TYPE_UNSPECIFIED)
.addCredentialTypes(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
.build()
val resp = blockStub.createPresentationChallenge(req_CreatePresentationChallengeRequest)
println(resp)
channel.shutdown()
}
returns CreatePresentationChallengeResponse
CreatePresentationChallengeResponse
vc_api.v1.CreatePresentationChallengeResponse
vc_api.v1.CreatePresentationChallengeResponse
Field | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nonce | string | Value used for the challenge. | |||||||||||||||
endpoint | string | Used by browser to construct URL for QR generation. | |||||||||||||||
credential_types | CredentialType
|
|
{
"nonce": "NonceLengthVariesByAlgo",
"endpoint": "QR_URL_ENDPOINT",
"credential_types": [
0,
1
]
}