The @zcloak/vc module is designed to facilitate the creation, issuance, and verification of Verifiable Credentials (VCs) within the zCloak Network. VCs are a key component of decentralized identity systems, allowing for the secure and verifiable exchange of claims about identity.
yarn add @zcloak/vcimport { VerifiableCredentialBuilder } from '@zcloak/vc';
...
Raw ClassThe Raw class represents a claim (raw credential) with its contents, owner, ctype, and hash type.
export class Raw implements IRaw {
public contents: AnyJson;
public owner: DidUrl;
public ctype: CType;
public hashType: HashType;
//......
}
Key methods include:
setContents(params)
public setContents(contents: AnyJson): this {
//......
}
contents attribute of the raw credential.contents - The contents in the form of JSON to set for the raw credential.this - The modified Raw instancesetOwner(params)
public setOwner(owner: DidUrl): this {
//......
}
owner attribute of the raw credential.owner - The DID URL to set as the owner for the raw credential