Hold a credential in a Registry

Overview

This tutorial explains how to create a credential that will be held in the Registry.

Create a credential in the Registry

To create a credential that will be stored in the Registry, set the persist attribute in the body to true.

http
Copy to clipboard.
1POST https://YOUR_TENANT_URL/v2/credentials/web-semantic/sign

Request

json
Copy to clipboard.
1
2{
3    "payload": {
4        "@context": [
5         "https://schema.org"
6          ],       
7        "name": "Course credential",
8        "description": "Course credential description",
9        "type": [
10        "CourseCredential"
11        ],
12        "credentialSubject": {
13            "id": "did:key:z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi",
14            "givenName": "Chris",
15            "familyName": "Shin",
16            "educationalCredentialAwarded": "Certificate Name"       
17        },       
18        "issuer": {
19            "id": " did:web:organization.com ",
20            "name": "tenant"   
21        },
22        "expirationDate": "2024-02-07T06:44:28.952Z"
23    },
24    
25  "tag": "external-identifier",
26  "persist": true
27    
28}
29 

When persist is set to true, both the credential and the credential meta-data will be held in the Registry.

When persist is set to false, only the following meta-data will be stored:

  • id

  • tag

  • credentialStatus (in the case of Revocation)

  • issuanceDate

For credentials issued using the OpenID or OIDC flow, the persist attribute will be false.

The optional tag attribute can be used to reference the issued credential using a value of any string up to 1024 characters. By setting the tag to an external identifier, it gets stored in the credential meta-data and it can be used to Search for a Credential in the Registry.

Response

json
Copy to clipboard.
1{
2  "id": "e6c9b6a2-d87b-4be1-8b3a-f3dc13b44b5c",
3  "tag": "external-identifier",
4  "credential": {
5    {
6      "@context": [
7        "https://www.w3.org/2018/credentials/v1",
8        "https://schema.org",
9        "https://w3id.org/vc-revocation-list-2020/v1"
10      ],
11      "type": [
12        "VerifiableCredential",
13        "CourseCredential"
14      ],
15      "issuer": {
16        "id": "did:web:organization.com",
17        "name": "Organization.com"
18      },
19      "name": "Course credential",
20      "description": "Course credential description",
21      "credentialSubject": {
22        "id": "did:key:z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi",
23        "givenName": "Chris",
24        "familyName": "Shin",
25        "educationalCredentialAwarded": "Certificate Name"
26      },
27      "issuanceDate": "2020-10-08T03:00:12.478Z",
28      "expirationDate": "2024-02-07T06:44:28.952Z"
29      "proof": {
30        "jws": "eyJhbGciOiJFZERTQSIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..PFXv7Kgc8tqxBELiLvPLgeksfo0hlE4adV3_zt6MRcyYY26FGxiB4ctAVez25JW86Z1o6EAbuGKVctMYB_psCw",
31        "type": "Ed25519Signature2018",
32        "created": "2020-10-08T03:00:12Z",
33        "proofPurpose": "assertionMethod",
34        "verificationMethod": "did:key:z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi#z6MkfxQU7dy8eKxyHpG267FV23agZQu9zmokd8BprepfHALi"
35      }
36    }
37  },
38  "issuanceDate": "2020-10-08T03:00:12.478Z"
39}

The credential that will be held in the Registry, including the tag as meta-data.