The @zcloak/verify module outlines some functions for the swift and convenient verification of Verifiable Credentials and Presentations.
yarn add @zcloak/verifyimport { vcVerify, vpVerify } from '@zcloak/verify';
The method:
ctypeVerify(params)
export function ctypeVerify(
ctype: CType, document?: DidDocument | DidResolver): Promise<boolean> {
//......
}
ctype - The CType object to be verified.document(optional) - The optional DidDocument or DidResolver to resolve the publisher's DID.boolean - Returns true if the verification is successful, indicating that the signature of the CType is valid. Returns false otherwise.The method:
didVerify(params)
export async function didVerify(
message: HexString | Uint8Array,
signature: HexString | Uint8Array,
signatureType: SignatureType,
didUrl: DidUrl,
resolverOrDidDocument?: DidDocument | DidResolver
): Promise<boolean> {
//......
}
true if the signature is valid and false otherwise.