Credentials management

The following functions are available for credentials management:

  • List - lists the available credentials

  • List compact - lists credential ids

  • Load - loads a credential by id

  • Store - store a credential

  • Delete - delete a credential by id

  • Present - create a verifiable presentation from specific credentials

  • Present stored - create a verifiable presentation from specific stored credential ids

List credentials

The /credentials endpoint lists the available credentials:

  • id - query parameter (optional) - the list of credentials ids

curl -X 'GET' \
  'https://custodian.ssikit.walt.id/credentials' \
  -H 'accept: application/json'

E.g. List the the credentials having ids urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84270 and urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84271

curl -X 'GET' \
  'https://custodian.ssikit.walt.id/credentials?id=urn%3Auuid%3Ad36986f1-3cc0-4156-b5a4-6d3deab84270&id=urn%3Auuid%3Ad36986f1-3cc0-4156-b5a4-6d3deab84271' \
  -H 'accept: application/json'

List credentials compact

The /credentials/list/credentialIds lists the available credentials ids.

curl -X 'GET' \
  'https://custodian.ssikit.walt.id/credentials/list/credentialIds' \
  -H 'accept: application/json'

E.g. List the available credentials ids.

curl -X 'GET' \
  'https://custodian.ssikit.walt.id/credentials/list/credentialIds' \
  -H 'accept: application/json'

Load credential

The /credentials/{id} loads a credential specified by:

  • id - path parameter (required) - the credential id

curl -X 'GET' \
  'https://custodian.ssikit.walt.id/credentials/{id}' \
  -H 'accept: application/json'

E.g. Load the credential having id = urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84270.

curl -X 'GET' \
  'https://custodian.ssikit.walt.id/credentials/urn%3Auuid%3Ad36986f1-3cc0-4156-b5a4-6d3deab84270' \
  -H 'accept: application/json'

Store credential

The /credentials/{alias} endpoint stores a verifiable credential by:

  • alias - path parameter (required) - the credential's id

curl -X 'PUT' \
  'https://custodian.ssikit.walt.id/credentials/urn%3Auuid%3Ad36986f1-3cc0-4156-b5a4-6d3deab84270' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '<request-body>'

E.g. Store the UniversityDegree verifiable credential.

curl -X 'PUT' \
  'https://custodian.ssikit.walt.id/credentials/urn%3Auuid%3Ad36986f1-3cc0-4156-b5a4-6d3deab84270' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "@context" : [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ],
  "credentialSubject" : {
    "degree" : {
      "name" : "Bachelor of Science and Arts",
      "type" : "BachelorDegree"
    },
    "id" : "did:web:my.domain"
  },
  "id" : "urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84270",
  "issued" : "2022-10-07T09:53:41.369913097Z",
  "issuer" : {
    "id" : "did:web:walt.id"
  },
  "validFrom" : "2022-10-07T09:53:41.369917079Z",
  "issuanceDate" : "2022-10-07T09:53:41.369917079Z",
  "type" : [ "VerifiableCredential", "UniversityDegreeCredential" ],
  "proof" : {
    "type" : "Ed25519Signature2018",
    "creator" : "did:web:walt.id",
    "created" : "2022-10-07T09:53:41Z",
    "domain" : "https://api.preprod.ebsi.eu",
    "nonce" : "dc2be572-cca4-43dc-9903-0fec1dcf786f",
    "jws" : "eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..7EYkgjNRJ_hh0F5kONnPfrC4PLvg1g82czeANllDngsbk36a8lnHSlwersSqY0tdER4xIe7vbNVzi39C2DZTDQ"
  }
}'

Delete credential

The /credentials/{alias} deletes a credential by:

  • alias - path parameter (required) - the credential's id

curl -X 'DELETE' \
  'https://custodian.ssikit.walt.id/credentials/{alias}' \
  -H 'accept: application/json'

E.g. Delete the credential with id = urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84270

curl -X 'DELETE' \
  'https://custodian.ssikit.walt.id/credentials/urn%3Auuid%3Ad36986f1-3cc0-4156-b5a4-6d3deab84270' \
  -H 'accept: application/json'

Present credential

The /credentials/present endpoint creates a verifiable presentation from the specified credentials.

curl -X 'POST' \
  'https://custodian.ssikit.walt.id/credentials/present' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '<request-body>'

E.g. Create a verifiable presentation from the provided VeriafiableID and OpenBadgeCredential credentials for a holder with did = did:web:my.domain.

curl -X 'POST' \
  'https://custodian.ssikit.walt.id/credentials/present' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "vcs": [
"{\r\n    \"@context\":\r\n    [\r\n        \"https:\/\/www.w3.org\/2018\/credentials\/v1\"\r\n    ],\r\n    \"credentialSchema\":\r\n    {\r\n        \"id\": \"https:\/\/api.preprod.ebsi.eu\/trusted-schemas-registry\/v1\/schemas\/0xb77f8516a965631b4f197ad54c65a9e2f9936ebfb76bae4906d33744dbcc60ba\",\r\n        \"type\": \"FullJsonSchemaValidator2021\"\r\n    },\r\n    \"credentialSubject\":\r\n    {\r\n        \"currentAddress\":\r\n        [\r\n            \"1 Boulevard de la Libert\u00E9, 59800 Lille\"\r\n        ],\r\n        \"dateOfBirth\": \"1993-04-08\",\r\n        \"familyName\": \"DOE\",\r\n        \"firstName\": \"Jane\",\r\n        \"gender\": \"FEMALE\",\r\n        \"id\": \"did:web:my.domain\",\r\n        \"nameAndFamilyNameAtBirth\": \"Jane DOE\",\r\n        \"personalIdentifier\": \"0904008084H\",\r\n        \"placeOfBirth\": \"LILLE, FRANCE\"\r\n    },\r\n    \"evidence\":\r\n    [\r\n        {\r\n            \"documentPresence\":\r\n            [\r\n                \"Physical\"\r\n            ],\r\n            \"evidenceDocument\":\r\n            [\r\n                \"Passport\"\r\n            ],\r\n            \"subjectPresence\": \"Physical\",\r\n            \"type\":\r\n            [\r\n                \"DocumentVerification\"\r\n            ],\r\n            \"verifier\": \"did:ebsi:2A9BZ9SUe6BatacSpvs1V5CdjHvLpQ7bEsi2Jb6LdHKnQxaN\"\r\n        }\r\n    ],\r\n    \"id\": \"urn:uuid:4d88d22e-214b-4aa3-a4e9-906da9daf36a\",\r\n    \"issued\": \"2022-10-09T10:11:51Z\",\r\n    \"issuer\": \"did:web:walt.id\",\r\n    \"validFrom\": \"2022-10-09T10:11:51Z\",\r\n    \"issuanceDate\": \"2022-10-09T10:11:51Z\",\r\n    \"type\":\r\n    [\r\n        \"VerifiableCredential\",\r\n        \"VerifiableAttestation\",\r\n        \"VerifiableId\"\r\n    ],\r\n    \"proof\":\r\n    {\r\n        \"type\": \"JsonWebSignature2020\",\r\n        \"creator\": \"did:web:walt.id\",\r\n        \"created\": \"2022-10-09T10:11:52Z\",\r\n        \"proofPurpose\": \"assertionMethod\",\r\n        \"verificationMethod\": \"did:web:walt.id#c1672b42f846471eb2c22fd601169566\",\r\n        \"jws\": \"eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..H4mLlx3Ot3rWV_EzthoiAjZs6J4UkJywuGENmSsqNHEnMGlwFHRKSNGWHwWnz2a7R38ktyo8r0_3sc2IkxGvCA\"\r\n    }\r\n}",
"{\r\n  \"@context\" : [ \"https:\/\/www.w3.org\/2018\/credentials\/v1\", \"https:\/\/w3c-ccg.github.io\/vc-ed\/plugfest-1-2022\/jff-vc-edu-plugfest-1-context.json\" ],\r\n  \"credentialSubject\" : {\r\n    \"achievement\" : {\r\n      \"criteria\" : {\r\n        \"narrative\" : \"The first cohort of the JFF Plugfest 1 in May\/June of 2021 collaborated to push interoperability of VCs in education forward.\",\r\n        \"type\" : \"Criteria\"\r\n      },\r\n      \"description\" : \"This wallet can display this Open Badge 3.0\",\r\n      \"image\" : \"https:\/\/w3c-ccg.github.io\/vc-ed\/plugfest-1-2022\/images\/plugfest-1-badge-image.png\",\r\n      \"name\" : \"Our Wallet Passed JFF Plugfest #1 2022\",\r\n      \"type\" : \"Achievement\"\r\n    },\r\n    \"id\" : \"did:web:my.domain\",\r\n    \"type\" : \"AchievementSubject\"\r\n  },\r\n  \"id\" : \"urn:uuid:1745f6ff-3e12-4678-b714-e779e989ae25\",\r\n  \"issuanceDate\" : \"2020-03-10T04:24:12.164Z\",\r\n  \"issued\" : \"2022-10-09T10:12:50Z\",\r\n  \"issuer\" : {\r\n    \"id\" : \"did:web:walt.id\",\r\n    \"image\" : \"https:\/\/kayaelle.github.io\/vc-ed\/plugfest-1-2022\/images\/JFF_LogoLockup.png\",\r\n    \"name\" : \"Jobs for the Future (JFF)\",\r\n    \"type\" : \"Profile\",\r\n    \"url\" : \"https:\/\/kayaelle.github.io\/vc-ed\/plugfest-1-2022\/images\/JFF_LogoLockup.png\"\r\n  },\r\n  \"validFrom\" : \"2022-10-09T10:12:50Z\",\r\n  \"type\" : [ \"VerifiableCredential\", \"OpenBadgeCredential\" ],\r\n  \"proof\" : {\r\n    \"type\" : \"JsonWebSignature2020\",\r\n    \"creator\" : \"did:web:walt.id\",\r\n    \"created\" : \"2022-10-09T10:12:50Z\",\r\n    \"proofPurpose\" : \"assertionMethod\",\r\n    \"verificationMethod\" : \"did:web:walt.id#c1672b42f846471eb2c22fd601169566\",\r\n    \"jws\" : \"eyJiNjQiOmZhbHNlLCJjcml0IjpbImI2NCJdLCJhbGciOiJFZERTQSJ9..8EIBOS-UKOUXboKElqWxRuux851NTbbll_sd16-67vv8Gh8vicJDNu7DjU-QgpsnJO_4mG8swxrOJeIFuU58Bg\"\r\n  }\r\n}"
  ],
  "holderDid": "did:web:my.domain"
}'

Present stored credential

The /credentials/presentIds endpoint creates a verifiable presentation from the specified credential ids.

curl -X 'POST' \
  'https://custodian.ssikit.walt.id/credentials/presentIds' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '<request-body>'

E.g. Create a verifiable presentation from the stored credential having id = urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84270 for the holder with did = did:web:my.domain.

curl -X 'POST' \
  'https://custodian.ssikit.walt.id/credentials/presentIds' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "vcIds": [
    "urn:uuid:d36986f1-3cc0-4156-b5a4-6d3deab84270"
  ],
  "holderDid": "did:web:my.domain"
}'

Last updated