Skip to content

Commit

Permalink
Ensure VC issuer matches key controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Nov 30, 2023
1 parent cf75691 commit a8f3e25
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/rt.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ async function main({credential, documentLoader}) {
ecdsaKeyPair.id = didDocument.assertionMethod[0];
ecdsaKeyPair.controller = didDocument.id;

// ensure issuer matches key controller
credential.issuer = ecdsaKeyPair.controller;

// setup ecdsa-rdfc-2019 signing suite
const signingSuite = new DataIntegrityProof({
signer: ecdsaKeyPair.signer(),
Expand Down Expand Up @@ -100,7 +103,7 @@ async function main({credential, documentLoader}) {
console.log('SIGNED CREDENTIAL:');
console.log(JSON.stringify(verifiableCredential, null, 2));
console.log('VERIFY RESULT:');
console.log(verifyResult);
console.log(JSON.stringify(verifyResult, null, 2));
}

// sample unsigned credential
Expand Down

0 comments on commit a8f3e25

Please sign in to comment.