fix sing vp

This commit is contained in:
Cayo Puigdefabregas 2024-06-06 17:06:30 +02:00
parent 31192aac56
commit cd2b5404fb
2 changed files with 6 additions and 4 deletions

View File

@ -78,11 +78,13 @@ class AuthorizeForm(forms.Form):
context = { context = {
"holder_did": did.did, "holder_did": did.did,
"verificable_credentials": vc_list,
"id": str(uuid.uuid4()) "id": str(uuid.uuid4())
} }
unsigned_vp = vp_template.render(context) unsigned_vp = vp_template.render(context)
vp = json.loads(unsigned_vp)
vp["verifiableCredential"] = vc_list
vp_str = json.dumps(vp)
key_material = did.get_key_material() key_material = did.get_key_material()
self.vp = sign(key_material, unsigned_vp, did.did) self.vp = sign(vp_str, key_material, did.did)

View File

@ -2,10 +2,10 @@
"@context": [ "@context": [
"https://www.w3.org/2018/credentials/v1" "https://www.w3.org/2018/credentials/v1"
], ],
"id": "{{ id }}"", "id": "{{ id }}",
"type": [ "type": [
"VerifiablePresentation" "VerifiablePresentation"
], ],
"holder": "{{ holder_did }}", "holder": "{{ holder_did }}",
"verifiableCredential": {{ verificable_credentials }} "verifiableCredential": ""
} }