IssueVerifiableCredential

Called by the holder to the VC issuer to answer the challenge and receive the credential.

rpc IssueVerifiableCredential

vc_api.v1.IssueVerifiableCredential

Called by the holder to the VC issuer to answer the challenge and receive the credential.

requests IssueVerifiableCredentialRequest

vc_api.v1.IssueVerifiableCredentialRequest

FieldTypeDescription
credential_typeCredentialType enum
FieldNumberDescription
CREDENTIAL_TYPE_UNSPECIFIED0Type of the verifiable credential being requested for issuance.Credential Type Unspecified.
CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD1Type of the verifiable credential being requested for issuance.Credential Type Permanent Resident Card.
CREDENTIAL_TYPE_BANK_CARD2Type of the verifiable credential being requested for issuance.Credential Type Bank Card.
CREDENTIAL_TYPE_BANK_ACCOUNT3Type of the verifiable credential being requested for issuance.Credential Type Bank Account.
noncestringValue used for the challenge.
signaturebytesSigned value of the challenge by the wallet.
didstringW3C Decentralized Identifier (DID) of the wallet.
resp, _ := credentialAdapterService.IssueVerifiableCredential(ctx, &v1.IssueVerifiableCredentialRequest{
  CredentialType: v1.CredentialType_CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD,
  Did: "did:method-name:zDIDMultibase58Encoded",
  Nonce: "NonceLengthVariesByAlgo",
  Signature: []byte{72,129,141,1,53,17,19,16,88,76,68},
})
fmt.Println(resp)
const issueverifiablecredentialrequest = new IssueVerifiableCredentialRequest();
issueverifiablecredentialrequest.setCredentialType(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD);
issueverifiablecredentialrequest.setDid("did:method-name:zDIDMultibase58Encoded");
issueverifiablecredentialrequest.setNonce("NonceLengthVariesByAlgo");
issueverifiablecredentialrequest.setSignature(Uint8Array.from([72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68]));

service.issueVerifiableCredential(issueverifiablecredentialrequest, (err, value:IssueVerifiableCredentialResponse|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 issueVerifiableCredentialRequest = new IssueVerifiableCredentialRequest{
        CredentialType = CredentialType.Credential_type_permanent_resident_card,
        Did = "did:method-name:zDIDMultibase58Encoded",
        Nonce = "NonceLengthVariesByAlgo",
        Signature = ByteString.CopyFrom(new byte[]{72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68}),
      };
      var reply = client.IssueVerifiableCredential(issueVerifiableCredentialRequest, 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.IssueVerifiableCredentialRequest;
import vc_api.v1.Vc.IssueVerifiableCredentialResponse;

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);
    
    IssueVerifiableCredentialRequest req_IssueVerifiableCredentialRequest =
        IssueVerifiableCredentialRequest.newBuilder()
          .setCredentialType(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setNonce("NonceLengthVariesByAlgo")
          .setSignature(com.google.protobuf.ByteString.copyFrom(new byte[]{72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68}))
          .build();
    IssueVerifiableCredentialResponse resp = blockStub.issueVerifiableCredential(req_IssueVerifiableCredentialRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const issueverifiablecredentialrequest = new IssueVerifiableCredentialRequest();
issueverifiablecredentialrequest.setCredentialType(CredentialType.CREDENTIAL_TYPE_UNSPECIFIED);
issueverifiablecredentialrequest.setDid("did:method-name:zDIDMultibase58Encoded");
issueverifiablecredentialrequest.setNonce("NonceLengthVariesByAlgo");
issueverifiablecredentialrequest.setSignature(Uint8Array.from([72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68]));

service.issueVerifiableCredential(issueverifiablecredentialrequest, (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::IssueVerifiableCredentialRequest;
use grpc-sdks::vc_api::v1::credential_adapter_service_client::CredentialAdapterServiceClient;
use grpc-sdks::vc_api::v1::CredentialType;

#[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(
    IssueVerifiableCredentialRequest{
      credential_type: CredentialType::CredentialTypePermanentResidentCard as i32,
      did: String::from("did:method-name:zDIDMultibase58Encoded"),
      nonce: String::from("NonceLengthVariesByAlgo"),
      signature: Vec::from([72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68])
    });
// sending request and waiting for response
  let response = client.issue_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.IssueVerifiableCredentialRequest
import vc_api.v1.Vc.IssueVerifiableCredentialResponse

fun main() {
    val channel = ManagedChannelBuilder
            .forAddress("vc.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
            .usePlaintext()
            .build()
    var blockStub = CredentialAdapterServiceGrpc.newBlockingStub(channel)
    
    val req_IssueVerifiableCredentialRequest = IssueVerifiableCredentialRequest.newBuilder()
          .setCredentialType(CredentialType.CREDENTIAL_TYPE_PERMANENT_RESIDENT_CARD)
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setNonce("NonceLengthVariesByAlgo")
          .setSignature(com.google.protobuf.ByteString.copyFrom(byteArrayOf(72, 129, 141, 1, 53, 17, 19, 16, 88, 76, 68)))
          .build()
    val resp = blockStub.issueVerifiableCredential(req_IssueVerifiableCredentialRequest)
    println(resp)
    channel.shutdown()
}


returns IssueVerifiableCredentialResponse

vc_api.v1.IssueVerifiableCredentialResponse

FieldTypeDescription
credentialstringType of the verifiable credential being issued.
{
  "credential": 1
}