File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -28,22 +28,22 @@ def validate(
2828 mdoc = MdocCbor ()
2929 mdoc .loads (data = token )
3030
31- # Materiale crittografico da validare con trust evaluator
32- # mdoc.issuersigned.issuer_auth.x509_certificates
33-
3431 if mdoc .verify () == False :
3532 raise MdocCborValidationError ("Signature is invalid" )
3633
37- for document in mdoc .documents :
38- x5c = [
39- cert .public_bytes (encoding = serialization .Encoding .PEM ).decode ()
40- for cert in document .issuersigned .issuer_auth .x509_certificates
41- ]
34+ try :
35+ for document in mdoc .documents :
36+ x5c = [
37+ cert .public_bytes (encoding = serialization .Encoding .PEM ).decode ()
38+ for cert in document .issuersigned .issuer_auth .x509_certificates
39+ ]
4240
43- self .trust_evaluator .get_public_keys (
44- get_issuer_from_x5c (x5c ),
45- {"x5c" : x5c }
46- )
41+ self .trust_evaluator .get_public_keys (
42+ get_issuer_from_x5c (x5c ),
43+ {"x5c" : x5c }
44+ )
45+ except Exception as e :
46+ raise MdocCborValidationError (f"Error validating keys: { e } " )
4747
4848 if self ._is_expired (mdoc ):
4949 raise MdocCborValidationError ("Credential is expired" )
You can’t perform that action at this time.
0 commit comments