Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions verifiable-credentials/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Experimental scripts for OIDC4VC

https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html
114 changes: 114 additions & 0 deletions verifiable-credentials/demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "55317a08",
"metadata": {},
"source": [
"# (selective disclosure) verifiable credential flow\n",
"\n",
"I'm using **walt.id** which is an open-source (Apache License 2.0) wallet toolkit. It's written with Kotlin."
]
},
{
"cell_type": "markdown",
"id": "7ba15cb5",
"metadata": {},
"source": [
"### Onboard an issuer (= OpenCRVS/country)\n",
"\n",
"A JWK (JSON web key) is created - you can treat this as an similar entity as the private/public-key pair OpenCRVS already holds."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c91d1430",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"issuerKey\":{\"type\":\"jwk\",\"jwk\":{\"kty\":\"OKP\",\"d\":\"tqm0LeR0kAHFkR5oJoi3wASWfGVcBNTKGXiMI7aWRq8\",\"crv\":\"Ed25519\",\"kid\":\"SOJUAenyIQE6aSOZsKqwawcZQrWQlOMDaWcD2rPdv08\",\"x\":\"-Siq8kqQ5mIaJAHpAUEDt6dFbRbJ6tCXryDaldVQkK0\"}},\"issuerDid\":\"did:jwk:eyJrdHkiOiJPS1AiLCJjcnYiOiJFZDI1NTE5Iiwia2lkIjoiU09KVUFlbnlJUUU2YVNPWnNLcXdhd2NaUXJXUWxPTURhV2NEMnJQZHYwOCIsIngiOiItU2lxOGtxUTVtSWFKQUhwQVVFRHQ2ZEZiUmJKNnRDWHJ5RGFsZFZRa0swIn0\"}"
]
}
],
"source": [
"!curl -X 'POST' \\\n",
" 'https://issuer.demo.walt.id/onboard/issuer' \\\n",
" -H 'accept: application/json' \\\n",
" -H 'Content-Type: application/json' \\\n",
" -d '{}'"
]
},
{
"cell_type": "markdown",
"id": "ff97db64",
"metadata": {},
"source": [
"### Issue an OIDC4VC SD-JWT credential\n",
"\n",
"This is just an example payload. It's to showcase the flow rather than the contents of the credential."
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "f295b3c7",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"openid-credential-offer://issuer.demo.walt.id/draft13/?credential_offer_uri=https%3A%2F%2Fissuer.demo.walt.id%2Fdraft13%2FcredentialOffer%3Fid%3D7b7f7c75-5e38-49a3-b8d9-a379f3c71b72"
]
}
],
"source": [
"!curl -X POST \"https://issuer.demo.walt.id/openid4vc/sdjwt/issue\" \\\n",
" -H \"accept: text/plain\" \\\n",
" -H \"Content-Type: application/json\" \\\n",
" -d @verifiable-credential.json"
]
},
{
"cell_type": "markdown",
"id": "373c8b5d",
"metadata": {},
"source": [
"### Create QR of credential offer"
]
},
{
"cell_type": "markdown",
"id": "d7032c98",
"metadata": {},
"source": [
"https://make-qr.github.io/"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
6 changes: 6 additions & 0 deletions verifiable-credentials/deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"imports": {
"@opencrvs/toolkit/api": "npm:@opencrvs/[email protected]/api",
"@opencrvs/toolkit/events": "npm:@opencrvs/[email protected]/events"
}
}
121 changes: 121 additions & 0 deletions verifiable-credentials/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading