Verify a Verifiable Credential
This tutorial offers step-by-step guidance on how to verify a JSON credential, encoded as a JWT (JSON Web Token), a W3C compliant proof format.
⚠️ Before you begin...
Make sure you've correctly configured the cheqd plugin's agent settings for Veramo CLI
Instructions
This tutorial assumes you have already issued a JSON/JWT Verifiable Credential so that it can be cryptographically verified as untampered.
Call Veramo's credential verify
function
credential verify
functionIf you have the issued Verifiable Credential stored in a file, say, cred.json
, pass it to the credential verify
function:
Instead of piping the file like above, you can also verify the credential using the raw credential or JWT as follows:
Then enter the JWT or entire JSON credential including the JWT.
Check credential verification output
If the credential can be verified correctly, the response will be:
Credential verification is done by decoding the JWT proof and checking if it's tampered or not. Feel free to test this yourself by tampering with the jwt
contents in the credential:
🤨 Troubleshoot verifying JWT credentials
If you belive you did everything right(created a verifiable credential and you did not tamper it), and for some reason you're getting
You can fix it the following way
First, make sure you are using a
node
with version16
or above.Second, change Veramo CLI version to
@veramo/cli@latest -g
as previous versions cause few issues in verification. This will override the previous version you have installed.
Run command below to verify your JWT credential.
Next steps
Look into how this credential can be shown to others through Verifiable Presentations.
Last updated