pki.tests.test_models.test_certificate_extensionsΒΆ

Tests for the parsing and handling of certificate extensions.

FunctionsΒΆ

test_key_usage_ext(self_signed_cert_with_ext)

Test that the KeyUsage extension is parsed and stored correctly in the database.

test_san_ext(self_signed_cert_with_ext)

Test that the SubjectAlternativeName extension is parsed and stored correctly in the database.

test_ian_ext(self_signed_cert_with_ext)

Test that the IssuerAlternativeName extension is parsed and stored correctly in the database.

test_basic_constraints_ext(self_signed_cert_with_ext)

Test that the BasicConstraints extension is parsed and stored correctly in the database.

test_authority_key_identifier_ext(...)

Test that the AuthorityKeyIdentifier extension is parsed and stored correctly in the database.

test_subject_key_identifier_ext(self_signed_cert_with_ext)

Test that the SubjectKeyIdentifier extension is parsed and stored correctly in the database.

test_certificate_policies_multiple_entries(...)

Test that policy extensions with multiple qualifier entries are parsed and stored correctly in the database.

test_extended_key_usage_ext(self_signed_cert_with_ext)

Test that the ExtendedKeyUsage extension is parsed and stored correctly in the database.

test_name_constraints_ext(self_signed_cert_with_ext)

Test that the NameConstraints extension is parsed and stored correctly in the database.

test_authority_information_access_extension(...)

Test that the AIA extension is parsed and stored correctly in the database.

test_subject_information_access_extension(...)

Test that the SIA extension is parsed and stored correctly in the database.

test_inhibit_any_policy(self_signed_cert_with_ext)

Test that the Inhibit anyPolicy extension is parsed and stored correctly in the database.

test_policy_constraints(self_signed_cert_with_ext)

Test that the Inhibit anyPolicy extension is parsed and stored correctly in the database.

test_freshest_crl(self_signed_cert_with_ext)

Test that the freshest crl extension is parsed and stored correctly in the database.

test_extension_deletion(self_signed_cert_with_ext)

Test that all extensions are deleted when the certificate is deleted.

test_extension_deletion(self_signed_cert_with_ext)

Test that all extensions are deleted when the certificate is deleted.

test_multi_extension_deletion(...)

Test that extensions that are shared are not deleted.

test_basic_certificate_deletion(self_signed_cert_basic)

Test that the basic certificate is deleted without exceptions.

Module ContentsΒΆ

pki.tests.test_models.test_certificate_extensions.test_key_usage_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the KeyUsage extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_san_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the SubjectAlternativeName extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_ian_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the IssuerAlternativeName extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_basic_constraints_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the BasicConstraints extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_authority_key_identifier_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the AuthorityKeyIdentifier extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_subject_key_identifier_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the SubjectKeyIdentifier extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_certificate_policies_multiple_entries(self_signed_cert_with_ext)[source]ΒΆ

Test that policy extensions with multiple qualifier entries are parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_extended_key_usage_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the ExtendedKeyUsage extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_name_constraints_ext(self_signed_cert_with_ext)[source]ΒΆ

Test that the NameConstraints extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_authority_information_access_extension(self_signed_cert_with_ext)[source]ΒΆ

Test that the AIA extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_subject_information_access_extension(self_signed_cert_with_ext)[source]ΒΆ

Test that the SIA extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_inhibit_any_policy(self_signed_cert_with_ext)[source]ΒΆ

Test that the Inhibit anyPolicy extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_policy_constraints(self_signed_cert_with_ext)[source]ΒΆ

Test that the Inhibit anyPolicy extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_freshest_crl(self_signed_cert_with_ext)[source]ΒΆ

Test that the freshest crl extension is parsed and stored correctly in the database.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_extension_deletion(self_signed_cert_with_ext, self_signed_cert_basic)[source]ΒΆ

Test that all extensions are deleted when the certificate is deleted.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_extension_deletion(self_signed_cert_with_ext)[source]ΒΆ

Test that all extensions are deleted when the certificate is deleted.

Parameters:

self_signed_cert_with_ext (cryptography.x509.Certificate)

Return type:

None

pki.tests.test_models.test_certificate_extensions.test_multi_extension_deletion(self_signed_cert_with_ext, self_signed_cert_basic)[source]ΒΆ

Test that extensions that are shared are not deleted.

(if there is another certificate with those exact extension values)

Parameters:
Return type:

None

pki.tests.test_models.test_certificate_extensions.test_basic_certificate_deletion(self_signed_cert_basic)[source]ΒΆ

Test that the basic certificate is deleted without exceptions.

Parameters:

self_signed_cert_basic (tuple[pki.models.certificate.CertificateModel, cryptography.x509.Certificate])

Return type:

None