CreateCredentialIssuer

Creates a verifiable credential Issuer

rpc CreateCredentialIssuer

registry_api.v1.CreateCredentialIssuer

Creates a verifiable credential Issuer

requests CreateCredentialIssuerRequest

registry_api.v1.CreateCredentialIssuerRequest

FieldTypeDescription
credential_issuerCredentialIssuerCredential Issuer.
resp, _ := credentialIssuerRegistryService.CreateCredentialIssuer(ctx, &v1.CreateCredentialIssuerRequest{
  CredentialIssuer: &v1.CredentialIssuer{
    Email: "[email protected]",
    IssuerDid: "did:method-name:zDIDIssuerMultibase58Encoded",
    IssuerName: "ISSUER_NAME",
    PostalAddress: &v1.PostalAddress{
      City: "Anytown",
      Country: "United States",
      PostalCode: "10101",
      State: "AL",
      Street: "123 Sesame Street",
    },
    Status: v1.IssuerStatus_ISSUER_STATUS_UNSPECIFIED,
    Website: "google.com",
  },
})
fmt.Println(resp)
const postaladdress = new PostalAddress();
postaladdress.setCity("Anytown");
postaladdress.setCountry("United States");
postaladdress.setPostalCode("10101");
postaladdress.setState("AL");
postaladdress.setStreet("123 Sesame Street");
const credentialissuer = new CredentialIssuer();
credentialissuer.setEmail("[email protected]");
credentialissuer.setIssuerDid("did:method-name:zDIDIssuerMultibase58Encoded");
credentialissuer.setIssuerName("ISSUER_NAME");
credentialissuer.setPostalAddress(postaladdress);
credentialissuer.setStatus(IssuerStatus.ISSUER_STATUS_SUSPENDED);
credentialissuer.setWebsite("google.com");
const createcredentialissuerrequest = new CreateCredentialIssuerRequest();
createcredentialissuerrequest.setCredentialIssuer(credentialissuer);

service.createCredentialIssuer(createcredentialissuerrequest, (err, value:CreateCredentialIssuerResponse|null) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
using System;
using Grpc.Core;
using RegistryApi.V1;

namespace main
{
  class Program
  {
    static void Main(string[] args)
    {
      Channel channel = new Channel("cred-reg-service.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure); 
      var client = new CredentialIssuerRegistryService.CredentialIssuerRegistryServiceClient(channel); 
      var headers = new Metadata();
      var postalAddress = new PostalAddress{
        City = "Anytown",
        Country = "United States",
        PostalCode = "10101",
        State = "AL",
        Street = "123 Sesame Street",
      };
      var credentialIssuer = new CredentialIssuer{
        Email = "[email protected]",
        IssuerDid = "did:method-name:zDIDIssuerMultibase58Encoded",
        IssuerName = "ISSUER_NAME",
        PostalAddress = postalAddress,
        Status = IssuerStatus.Issuer_status_unspecified,
        Website = "google.com",
      };
      var createCredentialIssuerRequest = new CreateCredentialIssuerRequest{
        CredentialIssuer = credentialIssuer,
      };
      var reply = client.CreateCredentialIssuer(createCredentialIssuerRequest, headers);
      Console.WriteLine("Response: " + reply);
      channel.ShutdownAsync().Wait();
    }
  }
}
package demo;

import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import registry_api.v1.CredentialIssuerRegistryServiceGrpc;
import registry_api.v1.Registry.CreateCredentialIssuerRequest;
import registry_api.v1.Registry.CreateCredentialIssuerResponse;
import registry_api.v1.Registry.CredentialIssuer;
import registry_api.v1.Registry.IssuerStatus;
import registry_api.v1.Registry.PostalAddress;

public class App {
  public static void main(String[] args) {
    ManagedChannel channel = ManagedChannelBuilder
      .forAddress("cred-reg-service.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
      .usePlaintext()
      .build();
    CredentialIssuerRegistryServiceGrpc.CredentialIssuerRegistryServiceBlockingStub blockStub =
        CredentialIssuerRegistryServiceGrpc.newBlockingStub(channel);
    
    PostalAddress req_PostalAddress =
        PostalAddress.newBuilder()
          .setCity("Anytown")
          .setCountry("United States")
          .setPostalCode("10101")
          .setState("AL")
          .setStreet("123 Sesame Street")
          .build();
    CredentialIssuer req_CredentialIssuer =
        CredentialIssuer.newBuilder()
          .setEmail("[email protected]")
          .setIssuerDid("did:method-name:zDIDIssuerMultibase58Encoded")
          .setIssuerName("ISSUER_NAME")
          .setPostalAddress(req_PostalAddress)
          .setStatus(IssuerStatus.ISSUER_STATUS_UNSPECIFIED)
          .setWebsite("google.com")
          .build();
    CreateCredentialIssuerRequest req_CreateCredentialIssuerRequest =
        CreateCredentialIssuerRequest.newBuilder()
          .setCredentialIssuer(req_CredentialIssuer)
          .build();
    CreateCredentialIssuerResponse resp = blockStub.createCredentialIssuer(req_CreateCredentialIssuerRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const postaladdress = new PostalAddress();
postaladdress.setCity("Anytown");
postaladdress.setCountry("United States");
postaladdress.setPostalCode("10101");
postaladdress.setState("AL");
postaladdress.setStreet("123 Sesame Street");
const credentialissuer = new CredentialIssuer();
credentialissuer.setEmail("[email protected]");
credentialissuer.setIssuerDid("did:method-name:zDIDIssuerMultibase58Encoded");
credentialissuer.setIssuerName("ISSUER_NAME");
credentialissuer.setPostalAddress(postaladdress);
credentialissuer.setStatus(IssuerStatus.ISSUER_STATUS_ACTIVE);
credentialissuer.setWebsite("google.com");
const createcredentialissuerrequest = new CreateCredentialIssuerRequest();
createcredentialissuerrequest.setCredentialIssuer(credentialissuer);

service.createCredentialIssuer(createcredentialissuerrequest, (err, value) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;

use grpc-sdks::registry_api::v1::credential_issuer_registry_service_client::CredentialIssuerRegistryServiceClient;
use grpc-sdks::registry_api::v1::CredentialIssuer;
use grpc-sdks::registry_api::v1::PostalAddress;
use grpc-sdks::registry_api::v1::IssuerStatus;
use grpc-sdks::registry_api::v1::CreateCredentialIssuerRequest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let channel = Channel::from_static("cred-reg-service.YOUR_SANDBOX_ID.knoxnetworks.io")
    .connect()
    .await?;
  let mut client = CredentialIssuerRegistryServiceClient::new(channel); 

  let request = tonic::Request::new(
    CreateCredentialIssuerRequest{
      credential_issuer: Some(CredentialIssuer{
        email: String::from("[email protected]"),
        issuer_did: String::from("did:method-name:zDIDIssuerMultibase58Encoded"),
        issuer_name: String::from("ISSUER_NAME"),
        postal_address: Some(PostalAddress{
          city: String::from("Anytown"),
          country: String::from("United States"),
          postal_code: String::from("10101"),
          state: String::from("AL"),
          street: String::from("123 Sesame Street")
        }),
        status: IssuerStatus::IssuerStatusUnspecified as i32,
        website: String::from("google.com")
      })
    });
// sending request and waiting for response
  let response = client.create_credential_issuer(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import registry_api.v1.CredentialIssuerRegistryServiceGrpc
import registry_api.v1.Registry.CreateCredentialIssuerRequest
import registry_api.v1.Registry.CreateCredentialIssuerResponse
import registry_api.v1.Registry.CredentialIssuer
import registry_api.v1.Registry.IssuerStatus
import registry_api.v1.Registry.PostalAddress

fun main() {
    val channel = ManagedChannelBuilder
            .forAddress("cred-reg-service.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
            .usePlaintext()
            .build()
    var blockStub = CredentialIssuerRegistryServiceGrpc.newBlockingStub(channel)
    
    val req_PostalAddress = PostalAddress.newBuilder()
          .setCity("Anytown")
          .setCountry("United States")
          .setPostalCode("10101")
          .setState("AL")
          .setStreet("123 Sesame Street")
          .build()
    val req_CredentialIssuer = CredentialIssuer.newBuilder()
          .setEmail("[email protected]")
          .setIssuerDid("did:method-name:zDIDIssuerMultibase58Encoded")
          .setIssuerName("ISSUER_NAME")
          .setPostalAddress(req_PostalAddress)
          .setStatus(IssuerStatus.ISSUER_STATUS_UNSPECIFIED)
          .setWebsite("google.com")
          .build()
    val req_CreateCredentialIssuerRequest = CreateCredentialIssuerRequest.newBuilder()
          .setCredentialIssuer(req_CredentialIssuer)
          .build()
    val resp = blockStub.createCredentialIssuer(req_CreateCredentialIssuerRequest)
    println(resp)
    channel.shutdown()
}


returns CreateCredentialIssuerResponse

registry_api.v1.CreateCredentialIssuerResponse

FieldTypeDescription
okbool
{
  "ok": true
}