Revoke

Revokes a DID document entry for a given DID in the Knox Registry Management Service.

rpc Revoke

registry_api.v1.Revoke

Revokes a DID document entry for a given DID in the Knox Registry Management Service.

requests RevokeRequest

registry_api.v1.RevokeRequest

FieldTypeDescription
didstringW3C Decentralized Identifier (DID) of the wallet.
documentstringDocument contains signature to proof the ownership of this DID.
resp, _ := registryService.Revoke(ctx, &v1.RevokeRequest{
  Did: "did:method-name:zDIDMultibase58Encoded",
  Document: "DOCUMENT",
})
fmt.Println(resp)
const revokerequest = new RevokeRequest();
revokerequest.setDid("did:method-name:zDIDMultibase58Encoded");
revokerequest.setDocument("DOCUMENT");

service.revoke(revokerequest, (err, value:RevokeResponse|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("reg.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure); 
      var client = new RegistryService.RegistryServiceClient(channel); 
      var headers = new Metadata();
      var revokeRequest = new RevokeRequest{
        Did = "did:method-name:zDIDMultibase58Encoded",
        Document = "DOCUMENT",
      };
      var reply = client.Revoke(revokeRequest, 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.Registry.RevokeRequest;
import registry_api.v1.Registry.RevokeResponse;
import registry_api.v1.RegistryServiceGrpc;

public class App {
  public static void main(String[] args) {
    ManagedChannel channel = ManagedChannelBuilder
      .forAddress("reg.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
      .usePlaintext()
      .build();
    RegistryServiceGrpc.RegistryServiceBlockingStub blockStub =
        RegistryServiceGrpc.newBlockingStub(channel);
    
    RevokeRequest req_RevokeRequest =
        RevokeRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setDocument("DOCUMENT")
          .build();
    RevokeResponse resp = blockStub.revoke(req_RevokeRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const revokerequest = new RevokeRequest();
revokerequest.setDid("did:method-name:zDIDMultibase58Encoded");
revokerequest.setDocument("DOCUMENT");

service.revoke(revokerequest, (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::registry_service_client::RegistryServiceClient;
use grpc-sdks::registry_api::v1::RevokeRequest;

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

  let request = tonic::Request::new(
    RevokeRequest{
      did: String::from("did:method-name:zDIDMultibase58Encoded"),
      document: String::from("DOCUMENT")
    });
// sending request and waiting for response
  let response = client.revoke(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import registry_api.v1.Registry.RevokeRequest
import registry_api.v1.Registry.RevokeResponse
import registry_api.v1.RegistryServiceGrpc

fun main() {
    val channel = ManagedChannelBuilder
            .forAddress("reg.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
            .usePlaintext()
            .build()
    var blockStub = RegistryServiceGrpc.newBlockingStub(channel)
    
    val req_RevokeRequest = RevokeRequest.newBuilder()
          .setDid("did:method-name:zDIDMultibase58Encoded")
          .setDocument("DOCUMENT")
          .build()
    val resp = blockStub.revoke(req_RevokeRequest)
    println(resp)
    channel.shutdown()
}


returns RevokeResponse

registry_api.v1.RevokeResponse

{}