Skip to content

Commit

Permalink
Qualification algorithm: beginnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasValvekens committed Dec 12, 2023
1 parent 83b2515 commit a66f596
Show file tree
Hide file tree
Showing 4 changed files with 816 additions and 25 deletions.
12 changes: 11 additions & 1 deletion pyhanko/sign/ades/qualified_asn1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from asn1crypto import core
from asn1crypto import core, x509

from pyhanko.sign.ades.asn1_util import register_x509_extension

Expand Down Expand Up @@ -93,4 +93,14 @@ class QcStatements(core.SequenceOf):
_child_spec = QcStatement


def get_qc_statements(cert: x509.Certificate) -> QcStatements:
for ext in cert['tbs_certificate']['extensions']:
if ext['extn_id'].native != 'qc_statements':
continue
qc_statements: QcStatements = ext['extn_value'].parsed
return qc_statements
else:
return QcStatements()


register_x509_extension('1.3.6.1.5.5.7.1.3', 'qc_statements', QcStatements)
Loading

0 comments on commit a66f596

Please sign in to comment.