owned this note
owned this note
Published
Linked with GitHub
# Examples for the vp_jwt, vp_ldp proposal
### Verifiable Presentation
The ID Token contains a `vp_jwt` or `vp_ldp` element with the Verifiable Presentation data, or a `vc_jwt` or `vc_ldp` element with the Verifiable Credential data.
Below is the example of an ID Token with `vp_jwt`:
```json
{
/// ID Token
"iss":"https://book.itsourweb.org:3000/wallet/wallet.html",
"aud":"https://book.itsourweb.org:3000/client_api/authresp/uhn",
"iat":1615910538,
"exp":1615911138,
"sub":"urn:uuid:68f874e2-377c-437f-a447-b304967ca351",
"auth_time":1615910535,
"vp_jwt":{
[ "ewogICAgImlzcyI6Imh0dHBzOi8vYm9vay5pdHNvdXJ3ZWIub3JnOjMwMDAvd2FsbGV0L3dhbGxl...IH0="
//an array that can include several VPs in a JWT format
//for VPs expressed in LD-proof format, "vp_ldp" will be used
//if VC is included directly in the ID token, "vc_jwt", or "vc_jdp" will be used
]
},
"nonce":"960848874",
"sub_jwk":{
"crv":"P-384",
"ext":true,
"key_ops":[
"verify"
],
"kty":"EC",
"x":"jf3a6dquclZ4PJ0JMU8RuucG9T1O3hpU_S_79sHQi7VZBD9e2VKXPts9lUjaytBm",
"y":"38VlVE3kNiMEjklFe4Wo4DqdTKkFbK6QrmZf77lCMN2x9bENZoGF2EYFiBsOsnq0"
}
}
```
Below is the decoded Verifiable Presentation that was included in `vp_jwt` inside the ID Token.
Note that `vp` is used to contain only "those parts of the standard verifiable presentation where no explicit encoding rules for JWT exist" [VC-DATA-MODEL]
```json
{ /// issuer, audience of Verifiable Presentation
"iss":"urn:uuid:68f874e2-377c-437f-a447-b304967ca351",
"jti":"urn:uuid:68f874e2-377c-437f-a447-b304967ca351",
"aud":"https://book.itsourweb.org:3000/ohip",
"iat":1615910538,
"exp":1615911138,
"nbf":1615910538,
"nonce":"acIlfiR6AKqGHg",
"vp":{
"@context":[
"https://www.w3.org/2018/credentials/v1",
"https://ohip.ontario.ca/v1"
],
"type":[
"VerifiablePresentation"
],
"verifiableCredential":[
"eyJ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irC7wqFPedqGC5MsaCNIqBAlsrzSm7bbpoj-73-_3
x6iEKvc8zOLZlHIVN4S9tl_H2HztYBv8GGuu2fvPdKzMRwdsxIV0Q-KDUEJQqX902TEFXqcffEFWp
1DJ3KFpFCNHsmf_mDztjqUZJtsBr5aMzxYypu9br5irBGS039USzFMvdVPLoZSCmR-HZqufbKnoih
dqwQaVxWU-o4fmQVx7_kmz7e9npe2TvlhMAmwOutBUhoUZAyjxpiiJEim5qnI2rD0KRw-i9qO6Dr9
OLryT1g"
]
}
}
```
Below is the decoded Verifiable Credential that was included in the Verifiable Presentation.
Note that `vc` is used to contain only "those parts of the standard verifiable presentation where no explicit encoding rules for JWT exist" [VC-DATA-MODEL]
```json
{
"sub":"urn:uuid:68f874e2-377c-437f-a447-b304967ca351",
"iss":"https://book.itsourweb.org:3000/ohip",
"iat":1615910155,
"exp":1616082955,
"aud":"https://book.itsourweb.org:3000/wallet/wallet.html",
"jti":"urn:uuid:7fe918f0-c172-434c-9d9b-3d21d45b3e62",
"vc":{
"@context":[
"https://www.w3.org/2018/credentials/v1",
"https://ohip.ontario.ca/v1"
],
"type":[
"VerifiableCredential",
"https://did.itsourweb.org:3000/smart-credential/Ontario-Health-Insurance-Plan"
],
"description":"OHIP status",
"credentialSubject":{
"healthNumber":"1122334455",
"versionNumber":"NV",
"dateOfBirth":"1995/07/10",
"firstName":"Jane",
"lastName":"Doe",
"postalCode":"M6H3B3",
"status":"OK"
}
}
}
```