Skip to content

Commit

Permalink
docs(sd-jwt): updated documentation to latest zencode
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaSelvaggini authored and jaromil committed Apr 24, 2024
1 parent d880195 commit 82e7cd6
Show file tree
Hide file tree
Showing 13 changed files with 381 additions and 332 deletions.
144 changes: 108 additions & 36 deletions docs/examples/zencode_cookbook/sd_jwt/create_request.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,115 @@
{
"supported_selective_disclosure":{
"authorization_endpoint":"http://issuer.example.org/authorize",
"authorization_response_iss_parameter_supported":true,
"claim_types_supported":["normal"],
"claims_parameter_supported":false,
"code_challenge_methods_supported":["S256"],
"credential_endpoint":"http://issuer.example.org/credentials",
"credential_issuer":"http://issuer.example.org",
"credentials_supported":[
"supported_selective_disclosure": {
"credential_issuer": "https://issuer1.zenswarm.forkbomb.eu/credential_issuer",
"credential_endpoint": "https://issuer1.zenswarm.forkbomb.eu/credential_issuer/credential",
"authorization_servers": [
"https://authz-server1.zenswarm.forkbomb.eu/authz_server"
],
"display": [
{
"name": "DIDroom_Issuer1",
"locale": "en-US"
}
],
"jwks": {
"keys": [
{
"kid": "did:dyne:sandbox.genericissuer:GPgX3sS1nNp7fgLWvvTSw4jUaEDLuBTNq5eJhvkVD9ER#es256_public_key",
"crv": "P-256",
"alg": "ES256",
"kty": "EC"
}
]
},
"credential_configurations_supported": [
{
"credentialSubject":{
"family_name":{"display":[{"locale":"en-US","name":"Family Name"}]},
"given_name":{"display":[{"locale":"en-US","name":"Given Name"}]}
"format": "vc+sd-jwt",
"cryptographic_binding_methods_supported": [
"jwk",
"did:dyne:sandbox.signroom"
],
"credential_signing_alg_values_supported": [
"ES256"
],
"proof_types_supported": {
"jwt": {
"proof_signing_alg_values_supported": [
"ES256"
]
}
},
"cryptographic_binding_methods_supported":["did:jwk"],
"cryptographic_suites_supported":["ES256"],
"display":[
{"background_color":"#000000",
"locale":"en-US",
"name":"IdentityCredential",
"text_color":"#ffffff"}
"display": [
{
"name": "Above 18 identity",
"locale": "en-US",
"logo": {
"url": "https://avatars.githubusercontent.com/u/481963",
"alt_text": "Dyne.org Logo"
},
"background_color": "#12107c",
"text_color": "#FFFFFF",
"description": "You can use this credential to prove your identity as name and surname, to prove your date of birth and if your age is above 18 or not."
}
],
"format":"vc+sd-jwt",
"id":"ab8c936e-b9ab-4cf5-9862-c3a25bb82996",
"order":["given_name","family_name"],
"types":["VerifiableCredential","IdentityCredential"]
"credential_definition": {
"type": [
"Identity"
],
"credentialSubject": {
"given_name": {
"mandatory": true,
"display": [
{
"name": "Current First Name",
"locale": "en-US"
}
],
"value_type": "string"
},
"family_name": {
"mandatory": true,
"display": [
{
"name": "Current Family Name",
"locale": "en-US"
}
],
"value_type": "string"
},
"birth_date": {
"mandatory": true,
"display": [
{
"name": "Date of Birth",
"locale": "en-US"
}
],
"value_type": "number"
},
"above_18": {
"mandatory": true,
"display": [
{
"name": "Is above 18",
"locale": "en-US"
}
],
"value_type": "string"
}
}
}
}
],
"grant_types_supported":["authorization_code","urn:ietf:params:oauth:grant-type:pre-authorized_code"],"id_token_signing_alg_values_supported":["ES256"],"issuer":"http://issuer.example.org","jwks_uri":"http://issuer.example.org/jwks","pushed_authorization_request_endpoint":"http://issuer.example.org/par","request_object_signing_alg_values_supported":["ES256"],"request_parameter_supported":true,"request_uri_parameter_supported":true,"response_modes_supported":["query"],"response_types_supported":["code"],"scopes_supported":["openid","IdentityCredential"],"subject_types_supported":["public"],"token_endpoint":"http://issuer.example.org/token",
"token_endpoint_auth_methods_supported":["none"]
]
},
"object": {
"family_name": "Lippo",
"given_name": "Mimmo",
"birth_date": 640856826,
"above_18": true,
"iss": "http://example.org",
"sub": "user 42",
"iat": 1713859327,
"exp": 1903161721
},

"object":{
"age":42,
"degree":"math",
"family_name":"Lippo",
"given_name":"Mimmo",
"iss":"http://example.org",
"sub":"user 42"
},
"id": "ab8c936e-b9ab-4cf5-9862-c3a25bb82996"
"id": "Identity"
}
2 changes: 1 addition & 1 deletion docs/examples/zencode_cookbook/sd_jwt/create_request.zen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Scenario 'sd_jwt'
Scenario 'sd_jwt': create request

Given I have 'supported_selective_disclosure'
Given I have a 'string' named 'id'
Expand Down
30 changes: 17 additions & 13 deletions docs/examples/zencode_cookbook/sd_jwt/create_request_out.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
{
"selective_disclosure_request": {
"fields": [
"given_name",
"family_name"
],
"object": {
"age": 42,
"degree": "math",
"family_name": "Lippo",
"given_name": "Mimmo",
"iss": "http://example.org",
"sub": "user 42"
}
"selective_disclosure_request": {
"fields": [
"given_name",
"family_name",
"birth_date",
"above_18"
],
"object": {
"above_18": true,
"birth_date": 640856800,
"exp": 1903161721,
"family_name": "Lippo",
"given_name": "Mimmo",
"iat": 1713859327,
"iss": "http://example.org",
"sub": "user 42"
}
}
}
41 changes: 16 additions & 25 deletions docs/examples/zencode_cookbook/sd_jwt/create_signed_sd.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
{
"The Issuer": {
"es256_public_key":"gyvKONZZiFmTUbQseoJ6KdAYJPyFixv0rMXL2T39sawziR3I49jMp/6ChAupQYqZhYPVC/RtxBI+tUcULh1SCg==",
"keyring":{
"es256":"XdjAYj+RY95+uyYMI8fR3+fmP5LyQaN54vyTTVKxZyA="
"es256_public_key": "gyvKONZZiFmTUbQseoJ6KdAYJPyFixv0rMXL2T39sawziR3I49jMp/6ChAupQYqZhYPVC/RtxBI+tUcULh1SCg==",
"keyring": {
"es256": "XdjAYj+RY95+uyYMI8fR3+fmP5LyQaN54vyTTVKxZyA="
}
},
"selective_disclosure_request": {
"fields":[
"given_name","family_name","email","phone_number",
"phone_number_verified","address","birthdate"
"fields": [
"given_name",
"family_name",
"birth_date",
"above_18"
],
"object": {
"given_name": "John",
"family_name": "Doe",
"email": "johndoe@example.com",
"phone_number": "+1-202-555-0101",
"phone_number_verified": true,
"address": {
"street_address": "123 Main St",
"locality": "Anytown",
"region": "Anystate",
"country": "US"
},
"birthdate": "1940-01-01",
"updated_at": 1570000000,
"nationalities": [
"US",
"DE"
],
"iss":"http://example.org",
"sub":"user 42"
"above_18": true,
"birth_date": 640856800,
"exp": 1903161721,
"family_name": "Lippo",
"given_name": "Mimmo",
"iat": 1713859327,
"iss": "http://example.org",
"sub": "user 42"
}
}
}
4 changes: 2 additions & 2 deletions docs/examples/zencode_cookbook/sd_jwt/create_signed_sd.zen
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Scenario 'sd_jwt'
Scenario 'es256'
Scenario 'sd_jwt': create sd-jwt
Scenario 'es256': public key

Given I am known as 'The Issuer'
and I have my 'keyring'
Expand Down
98 changes: 38 additions & 60 deletions docs/examples/zencode_cookbook/sd_jwt/create_signed_sd_out.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,40 @@
{
"selective_disclosure": {
"disclosures": [
[
"SXIfLdi88UgmS8yQd-pISg",
"given_name",
"John"
],
[
"djk3tB6tg-b9YreywNcWZA",
"family_name",
"Doe"
],
[
"BtAfeH3MnnhxEsb5iffykw",
"email",
"johndoe@example.com"
],
[
"ux1iQm3xqjOg8HybkyaOFQ",
"phone_number",
"+1-202-555-0101"
],
[
"mN461iU9OjmED9eUWOLC3Q",
"phone_number_verified",
true
],
[
"OrLGw1Iq6Y9QX-T9V0v5gQ",
"address",
{
"country": "US",
"locality": "Anytown",
"region": "Anystate",
"street_address": "123 Main St"
}
],
[
"crgoJmpiHJD8t7oM3FhA_Q",
"birthdate",
"1940-01-01"
]
"selective_disclosure": {
"disclosures": [
[
"SYRPbpHhkPH7Wra5Eh-xVg",
"given_name",
"Mimmo"
],
"payload": {
"_sd": [
"cTJ5M6ejWPSBGe17aB7P-3ZkiuUtV_iEaWZdNGluwqo",
"RFhdE3udH0Gva9WydmjL1jUM7W-4dA_eWclR0xZHSuE",
"zDO99vBzYsph-y7FpSNTG923nR4jbbHO0n1dsCzWjNA",
"xC36UWhgAXlWP7do45jGzJ9Z_h1C1Ys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sZS5jb20iXQ~WyJLeVNfVV9nTTdNcFp1blVsMG5RLTdRIiwgInBob25lX251bWJlciIsICIrMS0yMDItNTU1LTAxMDEiXQ~WyJXeVRpekhoMWlJMHpjOVpLZzgwdlFnIiwgInBob25lX251bWJlcl92ZXJpZmllZCIsIHRydWVd~WyJrckVwRThBTHVMR1Btdy1RamNNOXVRIiwgImFkZHJlc3MiLCB7ImNvdW50cnkiOiAiVVMiLCAibG9jYWxpdHkiOiAiQW55dG93biIsICJyZWdpb24iOiAiQW55c3RhdGUiLCAic3RyZWV0X2FkZHJlc3MiOiAiMTIzIE1haW4gU3QifV0~WyJ3VkZXYlNaaXdnY0VaYTFzWV96X01nIiwgImJpcnRoZGF0ZSIsICIxOTQwLTAxLTAxIl0~"

}
[
"_DAsJQ0LVzGAsSDyUqlbZA",
"family_name",
"Lippo"
],
[
"-yuyuj9XtpUl3BQZ0_tgtQ",
"birth_date",
640856800
],
[
"codjG-WqsREtxUAXnQM9aQ",
"above_18",
true
]
],
"payload": {
"_sd": [
"U2kEVLx7yyeGvHjv-Ooe-9L83quBaQsZoVt0czrXHJ0",
"dco6Gf7wrOPdU1JegneIn757ZMTcyfuBhXzDepUSyJ8",
"Urz5C5fup95JNRYIfAfUd4Fv_3nfZOKh0hrzpALWVSk",
"HSZaO57OEELA7lznX-6zL-XXg-CSt0DFIiwuowg_DLY"
],
"_sd_alg": "sha-256",
"exp": 1903161721,
"iat": 1713859327,
"iss": "http://example.org",
"sub": "user 42"
}
},
"signed_selective_disclosure": "eyJhbGciOiAiRVMyNTYiLCAidHlwIjogInZjK3NkLWp3dCJ9.eyJfc2QiOiBbIlUya0VWTHg3eXllR3ZIanYtT29lLTlMODNxdUJhUXNab1Z0MGN6clhISjAiLCAiZGNvNkdmN3dyT1BkVTFKZWduZUluNzU3Wk1UY3lmdUJoWHpEZXBVU3lKOCIsICJVcno1QzVmdXA5NUpOUllJZkFmVWQ0RnZfM25mWk9LaDBocnpwQUxXVlNrIiwgIkhTWmFPNTdPRUVMQTdsem5YLTZ6TC1YWGctQ1N0MERGSWl3dW93Z19ETFkiXSwgIl9zZF9hbGciOiAic2hhLTI1NiIsICJleHAiOiAxOTAzMTYxNzIxLCAiaWF0IjogMTcxMzg1OTMyNywgImlzcyI6ICJodHRwOi8vZXhhbXBsZS5vcmciLCAic3ViIjogInVzZXIgNDIifQ.XP1SerkTSZbO_8zB2CZsfc-w4fjruHTdDeQlkgSeEj3v4u9v6UhJXW0d5c_-mfMJtD3EEt3hFloGceeegrbESg~WyJTWVJQYnBIaGtQSDdXcmE1RWgteFZnIiwgImdpdmVuX25hbWUiLCAiTWltbW8iXQ~WyJfREFzSlEwTFZ6R0FzU0R5VXFsYlpBIiwgImZhbWlseV9uYW1lIiwgIkxpcHBvIl0~WyIteXV5dWo5WHRwVWwzQlFaMF90Z3RRIiwgImJpcnRoX2RhdGUiLCA2LjQwODU2OGUrMDhd~WyJjb2RqRy1XcXNSRXR4VUFYblFNOWFRIiwgImFib3ZlXzE4IiwgdHJ1ZV0~"
}

0 comments on commit 82e7cd6

Please sign in to comment.