Skip to content

Commit

Permalink
qcp-n-qscd: 411-1 policy presence validator
Browse files Browse the repository at this point in the history
  • Loading branch information
breynders-cb committed Oct 29, 2024
1 parent 175a369 commit e06fa2d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkilint/etsi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ def create_validators(
certificate_type in etsi_constants.QCP_N_CERTIFICATE_TYPES
or certificate_type in etsi_constants.CABF_CERTIFICATE_TYPES
):
extension_validators.append(en_319_411_1.CertificatePoliciesPresenceValidator())
extension_validators.append(
en_319_411_1.CertificatePoliciesValidator(certificate_type)
)
Expand Down
15 changes: 15 additions & 0 deletions pkilint/etsi/en_319_411_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
from pkilint import validation, oid
from pkilint.etsi import etsi_constants
from pkilint.etsi.asn1 import en_319_411_1
from pkilint.pkix import extension


class CertificatePoliciesPresenceValidator(extension.ExtensionPresenceValidator):
VALIDATION_CERTIFICATE_POLICIES_EXTENSION_ABSENT = validation.ValidationFinding(
validation.ValidationFindingSeverity.ERROR,
"etsi.en_319_411_1.OVR-5.3.01.certificate_policies_extension_missing",
)

def __init__(self):
super().__init__(
extension_oid=rfc5280.id_ce_certificatePolicies,
validation=self.VALIDATION_CERTIFICATE_POLICIES_EXTENSION_ABSENT,
pdu_class=rfc5280.Extensions,
)


class CertificatePoliciesValidator(validation.Validator):
Expand Down

0 comments on commit e06fa2d

Please sign in to comment.