Skip to content

Commit 5ab28ed

Browse files
committed
fixed issue in signing and verifying the signed jwt
1 parent 1f3e5f1 commit 5ab28ed

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spp_openid_vci/models/vci_issuer.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,19 @@ def onchange_auth_allowed_issuers(self):
1111
args = [rec, f"set_default_auth_allowed_issuers_{rec.issuer_type}"]
1212
if hasattr(*args):
1313
getattr(*args)()
14+
15+
def sign_and_issue_credential(self, credential: dict) -> dict:
16+
self.ensure_one()
17+
18+
ld_proof = self.build_empty_ld_proof()
19+
20+
signature = self.get_encryption_provider().jwt_sign(
21+
{"credential": credential, "proof": ld_proof},
22+
include_payload=False,
23+
include_certificate=True,
24+
include_cert_hash=True,
25+
)
26+
ld_proof["jws"] = signature
27+
ret = dict(credential)
28+
ret["proof"] = ld_proof
29+
return ret

0 commit comments

Comments
 (0)