The @zcloak/verify module outlines some functions for the swift and convenient verification of Verifiable Credentials and Presentations.

Integration steps

  1. Installation: yarn add @zcloak/verify
  2. Import the necessary classes and functions.
import { vcVerify, vpVerify } from '@zcloak/verify';

Key Classes and Functions

Verifying Credential Type

The method:

ctypeVerify(params)

export function ctypeVerify(
ctype: CType, document?: DidDocument | DidResolver): Promise<boolean> {
  //......
}

Verifying DID

The method:

didVerify(params)

export async function didVerify(
  message: HexString | Uint8Array,
  signature: HexString | Uint8Array,
  signatureType: SignatureType,
  didUrl: DidUrl,
  resolverOrDidDocument?: DidDocument | DidResolver
): Promise<boolean> {
  //......
}