🚧 This section is under construction to make a more comprehensive guide for implementing share & present flows in your applications. Thank you for being patient while our community gets another cup of coffee to finish these docs! ☕️I
Issue/Verify Presentations
Similar to Verifiable Credentials, Verifiable Presentations also have methods that can be used to issue and verify:
constunsignedVp=awaitlearnCard.invoke.getTestVp();//Package signed Verifiable Credential into the presentationunsignedVp.verifiableCredential = signedVc;constvp=awaitlearnCard.invoke.issuePresentation(unsignedVp);constresult=awaitlearnCard.invoke.verifyPresentation(vp);console.log(result);// {// checks: ['proof'],// warnings: [],// errors: [],// }
constunsignedVp=awaitlearnCard.invoke.getTestVp();constvp=awaitlearnCard.invoke.issuePresentation(unsignedVp);vp.holder ='did:key:nope';constresult=awaitlearnCard.invoke.verifyPresentation(vp);console.log(result);// {// checks: [],// warnings: [],// errors: ['Unable to filter proofs: Unable to resolve: invalidDid'],// }