Verify a Verifiable Credential
Verify a Verifiable Credential, signed by a did:cheqd Decentralized Identifier (DID), using Veramo.
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:
cat cred.json | veramo credential verifyInstead of piping the file like above, you can also verify the credential using the raw credential or JWT as follows:
veramo credential verify --rawThen 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 verified successfullyCredential 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:
Credential could not be verified🤨 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
Credential could not be verifiedYou can fix it the following way
- First, make sure you are using a - nodewith version- 16or above.
- Second, change Veramo CLI version to - @veramo/cli@latest -gas previous versions cause few issues in verification. This will override the previous version you have installed.
    npm i @veramo/cli@latest -g- Run command below to verify your JWT credential. 
veramo credential verify -r <enter-the-JWT-here>Next steps
Look into how this credential can be shown to others through Verifiable Presentations.
Last updated
Was this helpful?
