digitalbazaar / jsonld-signatures

An implementation of the Linked Data Signatures specification for JSON-LD. Works in the browser and Node.js.
BSD 3-Clause "New" or "Revised" License
138 stars 41 forks source link

How to export jsonld signed credentials #175

Closed projjal1 closed 1 year ago

projjal1 commented 1 year ago

Hi, I have created signed credential with jsigs.sign(). Now my question is how to export the same for future reference ? When I try to copy/paste it in jsonld file from console, during verification it gives error.

dmitrizagidulin commented 1 year ago

Hi, I have created signed credential with jsigs.sign(). Now my question is how to export the same for future reference ? When I try to copy/paste it in jsonld file from console, during verification it gives error.

Hi @projjal1. If you're currently doing console.log(signedVc), you should instead do: console.log(JSON.stringify(signedVc, null, 2)).

Does that make sense?

projjal1 commented 1 year ago

Yes it fixes the issue. What I found is first I need to json.stringify signedVC and then in verifier json.parse the string and then proceed.