TalaoDAO / talao-wallet

An open source SSI wallet prpposed as a white label solution - EBSI conformant
https://talao.io
Apache License 2.0
12 stars 5 forks source link

4/ Present credential #220

Closed hawkbee1 closed 2 years ago

hawkbee1 commented 2 years ago

image

Create vp_token it is a verifiable presentation signed by DidKit. In this presentation non ascii characters are escaped by a code (that's probably jsonencode). The process is similar to existing _verifiablePresentationRequest function. We use DIDKitProvider.instance.issuePresentation with:

create id_token id_token is a signed Json Web Token (JWT). header = { "typ" :"JWT", "kid": "did:web:ecole42.talao.co#key-1" //kid from wallet RSA key } payload = { "exp": 1311281970, // current time + 1 minute "iat": 1311280970, // current time “i_am_siop” : true, "sub": “did:web:ecole42.talao.co” // wallet DID, "nonce": nonce, // nonce from selected instructions selected in QR code data }

Payload and header are signed with RSA key and following package: https://pub.dev/packages/jose

Create POST request POST is sent to redirect_uri from instructions selected in QR code data. Content-Type: application/x-www-form-urlencoded data = id_token=encoded_jwt&vp_token=verifiable_presentation There is a stackoverflow question about How to post x-www-form-urlencoded in Flutter

hawkbee1 commented 2 years ago

complexity: 5 warning: We never used package https://pub.dev/packages/jose and some testing needs to be done. Warning: crypto_keys package may be enough to do this job.