Credential

Verifiable Credential

Credentials will be issued based on a template and will be stored in the user's wallet. Each credential has a specific issuer and belongs to a specific user. Therefore you need to specify the wallet when issuing it.

Credentials expired: Credentials can be expired. You can pass credentialExpiration to time expired for credentials.

Issue Credential

POST https://api.dentity.com/core/api/v1/programmatic/credential

Issues a credential from a previously defined template. Credential templates can be created in Dentity business site or by using Dentity API.

Request Body

Name
Type
Description

walletId*

String

User’s wallet address

...rest

String

Fields based on “customFields” Credential Template

credentialExpiration*

Number (Unix time) or null

Credential expiration. NOTE: It must be greater than the current date and less or equal than template expiration.

credentialTemplateId*

String

Template ID

{
    "data": {
        "credentialId": "654cb11409081b002b4f782f",
        "templateId": "654856f46e1395002b6d9526"
    }
}

Get Credential Detail

GET https://api.dentity.com/core/api/v1/programmatic/credential/:id

Fetches credential details

Path Parameters

Name
Type
Description

id*

String

Credential ID

{
    "data": {
        "status": "active",
        "isSeparated": false,
        "_id": "65374cb71530d2002b5e133d",
        "detail": {
            "@context": [
                "https://www.w3.org/2018/credentials/v1",
                "https://w3id.org/bbs/v1",
                {
                    "@vocab": "https://trinsic.cloud/dentity-dev/"
                }
            ],
            "type": [
                "VerifiableCredential",
                "IssueTemplateOriginator61dbb8930dfa450011f7d9aa1698122828731"
            ],
            "credentialSchema": [
                {
                    "id": "https://schema.trinsic.cloud/dentity-dev/issue-template-originator-61dbb8930dfa450011f7d9aa-1698122828731",
                    "type": "JsonSchemaValidator2018"
                }
            ],
            "credentialSubject": {
                "credentialIssuer": "Issue Template Originator",
                "credentialType": "Issue Template Originator",
                "holderFullName": "Leslie Knope",
                "id": "urn:vc:subject:0"
            },
            "id": "urn:vc",
            "issuanceDate": "2023-10-24T04:48:55Z",
            "credentialStatus": {
                "id": "https://dentity-dev.connect.trinsic.cloud/credential-status/W9U5cYArzKKuFZE6yY7wQH#0",
                "type": "RevocationList2020Status",
                "revocationListIndex": "0",
                "revocationListCredential": "https://dentity-dev.connect.trinsic.cloud/credential-status/W9U5cYArzKKuFZE6yY7wQH"
            },
            "issuer": "did:web:dentity-dev.connect.trinsic.cloud:z8wCvUe4sM5eTnYYHFaxxjs",
            "proof": {
                "type": "BbsBlsSignature2020",
                "created": "2023-10-24T04:48:55Z",
                "proofPurpose": "assertionMethod",
                "proofValue": "lIhBZ7yg99DPjYYyp98f1q+YayTt3vrW0VTz3Jmja6n+J5zFBA1SfDo/F5Nl4ffBFyuoonXH+p3MRILXXzMQ/y9q/R5d68jR4r9M753HBuVdhq2pq7r4VJGFMq/NebGEbu1OBrVuVjhtYsxHR2U/5g==",
                "verificationMethod": "did:web:dentity-dev.connect.trinsic.cloud:z8wCvUe4sM5eTnYYHFaxxjs#z9KMl1J5wRrDBZ2J4m5P3EUqo4F86pHgCmLeT5Bviqo"
            }
        },
        "templateId": "urn:template:dentity-dev:issue-template-originator-61dbb8930dfa450011f7d9aa-1698122828731",
        "templateName": "Issue Template Originator",
        "credentialId": "65374cb71530d2002b5e133d",
        "template": "65374c4d1530d2002b5e1339",
        "partner": "61dbb8930dfa450011f7d9aa",
        "credentialSubjectsData": {
            "credentialIssuer": "Issue Template Originator",
            "credentialType": "Issue Template Originator",
            "holderFullName": "Leslie Knope"
        },
        "offerCredential": "65374cb71530d2002b5e133e",
        "dateCreated": "2023-10-24T04:48:55.685Z",
        "dateUpdated": "2023-10-24T04:48:55.685Z",
        "__v": 0
    }
}

Delete Credential in Wallet

DELETE https://api.dentity.com/core/api/v1/programmatic/credential/:id

Deletes a credential by ID.

Path Parameters

Name
Type
Description

id*

String

Credential ID

{
    "data": {
        "isSuccess": true
    }
}

Verify Credential Proof

POST https://api.dentity.com/core/api/v1/credential/proofs/verify

Verify proof that you received when Holder finished OIDC for Verifiable Presentation.

Request Body

Name
Type
Description

proofs

Array object

{
  "data": [
    {
      "isValid": true,
      "validationResults": {
        "CredentialStatus": {
          "isValid": true,
          "messages": []
        },
        "IssuerIsSigner": {
          "isValid": true,
          "messages": []
        },
        "SchemaConformance": {
          "isValid": true,
          "messages": []
        },
        "SignatureVerification": {
          "isValid": true,
          "messages": []
        },
        "TrustRegistryMembership": {
          "isValid": true,
          "messages": []
        }
      }
    }
  

Validation results: The verification process performs a number of validations, each of which may fail independently of the others.

For example, a credential may be expired or revoked, but otherwise perfectly valid. validation_results contains an entry for each of the following verification steps:

Name
Description

SignatureVerification

The cryptographic proof over the entire Verifiable Credential, specifically using BBS+ Proof of Signature

CredentialStatus

(if supported by credential) Checks if credential has been revoked

SchemaConformance

Ensures credential conforms with its schema. It is possible to issue a credential omitting a required field (as captured in the credential template). If your use case allows this kind of omission, you can ignore this validation entry.

TrustRegistryMembership

(if relevant) Verifies that credential issuer is an authorized member of the credential's governing Trust Registry

IssuerIsSigner

Document issuer is same DID as document signer. If false, it is not safe to assume that the claimed issuer actually issued the credential.

Last updated