Construct proof

Important

Before constructing proof, ensure that you have signed the message.

Construct the proof attribute of the credential by adding the signature and public key.

const credentialBLSSigned = Object.assign({}, credential);
// add proof value into VC
credentialBLSSigned.proof = {
  type: "BbsBlsSignature2020",
  created: issuanceDate, // current time stamp ex. "2020-04-26T04:21:07Z"
  verificationMethod: Buffer.from(keyPair.publicKey).toString("base64"),
  proofPurpose: "assertionMethod",
  proofValue: Buffer.from(signature).toString("base64"),
};

Now, we have a Verifiable Credential of the BbsBlsSignature2020 signature type. This VC can be provided to the Holder for verification here.