arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Verify a Verifiable Credential

Verify a W3C Verifiable Credential using cheqd Studio.

Once you have issued your credential and have a JWT as part of the credential proof, you can use the /credential/verify API to check that the JWT has not been tampered.

hashtag
Step 1: Obtain Credential to Verify

To verify a Credential, you can either pass the full Credential body or the JWT proof. These can be either obtained from a Credential that has been issued or from a Verifiable Presentation presented to the user.

hashtag
Step 2: Configure Verification Parameters

The user is able to set verification parameters to filter whether they want to verify certain aspects of a Credential, including:

chevron-rightverifyStatushashtag
  • true (indicates that the user wants to verify the Credential Status, requiring a credentialStatus property to be present in the Credential)

  • false (Default. Indicates that the user does not want to verify the Credential Status.

chevron-rightfetchRemoteContextshashtag

When dealing with JSON-LD type Verifiable Credentials you also MUST provide the proper contexts within a Credential body. Set this to true ONLY if you want the @context URLs to be fetched in case they are a custom context.

  • true

hashtag
Step 3: Pass the Credential to the API

Simply paste the JWT or the full credential body into the request field of the /credential/verify API, and the API will give you a response including the following verification policies:

  1. Whether the Credential has been tampered

  2. Whether the Credential has a valid issuance date

  3. Whether the Credential has expired

false (default)

Whether the Credential Status is valid

hashtag
Verify a Verifiable Credential.

post
/credential/verify

This endpoint verifies a Verifiable Credential passed to it. As input, it can take the VC-JWT as a string or the entire credential itself.

Authorizations
x-api-keystringRequired
Query parameters
verifyStatusbooleanOptional

If set to true the verification will also check the status of the credential. Requires the VC to have a credentialStatus property.

Default: false
fetchRemoteContextsbooleanOptional

When dealing with JSON-LD you also MUST provide the proper contexts. Set this to true ONLY if you want the @context URLs to be fetched in case they are a custom context.

Default: false
allowDeactivatedDidbooleanOptional

If set to true allow to verify credential which based on deactivated DID.

Default: false
Body
credentialobjectOptional

Verifiable Credential to be verified as a VC-JWT string or a JSON object.

issuanceDatebooleanOptional

Policy to skip the issuanceDate (nbf) timestamp check when set to false.

Default: true
expirationDatebooleanOptional

Policy to skip the expirationDate (exp) timestamp check when set to false.

Default: true
audiencebooleanOptional

Policy to skip the audience check when set to false.

Default: false
checkExternalProviderbooleanOptional

Policy to also check other providers when set to true.

Default: false
Responses
chevron-right
200

The request was successful.

application/json
verifiedbooleanOptional
issuerstringOptional
signerobjectOptional
jwtstringOptional
verifiableCredentialobjectOptional
chevron-right
400

A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.

No content

chevron-right
401

Access token is missing or invalid

No content

chevron-right
500

An internal error has occurred. Additional state information plus metadata may be available in the response body.

No content

post
/credential/verify
POST /credential/verify HTTP/1.1
Host: studio-api.cheqd.net
x-api-key: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 119

"credential={}&policies={'issuanceDate':true,'expirationDate':true,'audience':false,'checkExternalProvider':false}"
{
  "verified": true,
  "polices": {},
  "issuer": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
  "signer": {
    "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0",
    "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1",
    "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt",
    "type": "Ed25519VerificationKey2018"
  }
}