pki.tests.test_util_cert_req_converterΒΆ
Tests for pki.util.cert_req_converter module.
ClassesΒΆ
Test _san_value_to_json method. |
|
Test _ku_value_to_json method. |
|
Test to_json method. |
|
Test validity_period_from_json method. |
|
Test from_json method. |
|
Test JSONCertRequestCommandExtractor methods. |
FunctionsΒΆ
Generate a test RSA private key. |
|
|
Create a basic CSR for testing. |
Module ContentsΒΆ
- pki.tests.test_util_cert_req_converter.private_key()[source]ΒΆ
Generate a test RSA private key.
- Return type:
cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey
- pki.tests.test_util_cert_req_converter.basic_csr(private_key)[source]ΒΆ
Create a basic CSR for testing.
- Parameters:
private_key (cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey)
- Return type:
cryptography.x509.CertificateSigningRequest
- class pki.tests.test_util_cert_req_converter.TestJSONCertRequestConverterSANValueToJson[source]ΒΆ
Test _san_value_to_json method.
- class pki.tests.test_util_cert_req_converter.TestJSONCertRequestConverterKUValueToJson[source]ΒΆ
Test _ku_value_to_json method.
- test_ku_key_agreement_with_encipher_only()[source]ΒΆ
Test KeyUsage with key_agreement and encipher_only.
- Return type:
None
- class pki.tests.test_util_cert_req_converter.TestJSONCertRequestConverterToJson[source]ΒΆ
Test to_json method.
- test_to_json_with_none_raises_error()[source]ΒΆ
Test that to_json raises ValueError when CSR is None.
- Return type:
None
- test_to_json_basic_csr(basic_csr)[source]ΒΆ
Test to_json with a basic CSR.
- Parameters:
basic_csr (cryptography.x509.CertificateSigningRequest)
- Return type:
None
- test_to_json_csr_with_san(private_key)[source]ΒΆ
Test to_json with CSR containing SAN extension.
- Parameters:
private_key (cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey)
- Return type:
None
- test_to_json_csr_with_key_usage(private_key)[source]ΒΆ
Test to_json with CSR containing KeyUsage extension.
- Parameters:
private_key (cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey)
- Return type:
None
- test_to_json_csr_with_extended_key_usage(private_key)[source]ΒΆ
Test to_json with CSR containing ExtendedKeyUsage extension.
- Parameters:
private_key (cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey)
- Return type:
None
- class pki.tests.test_util_cert_req_converter.TestJSONCertRequestConverterValidityPeriodFromJson[source]ΒΆ
Test validity_period_from_json method.
- test_validity_with_duration()[source]ΒΆ
Test parsing validity with duration in seconds.
- Return type:
None
- class pki.tests.test_util_cert_req_converter.TestJSONCertRequestConverterFromJson[source]ΒΆ
Test from_json method.
- test_from_json_with_extended_key_usage()[source]ΒΆ
Test from_json with ExtendedKeyUsage extension.
- Return type:
None
- class pki.tests.test_util_cert_req_converter.TestJSONCertRequestCommandExtractor[source]ΒΆ
Test JSONCertRequestCommandExtractor methods.
- test_sample_request_to_openssl_subj_basic()[source]ΒΆ
Test converting subject to OpenSSL format.
- Return type:
None
- test_sample_request_to_openssl_subj_empty()[source]ΒΆ
Test converting empty subject to OpenSSL format.
- Return type:
None
- test_sample_request_to_openssl_cmp_sans()[source]ΒΆ
Test converting SANs to OpenSSL CMP format.
- Return type:
None
- test_sample_request_to_openssl_cmp_sans_critical()[source]ΒΆ
Test converting critical SANs to OpenSSL CMP format.
- Return type:
None
- test_sample_request_to_openssl_req_sans()[source]ΒΆ
Test converting SANs to OpenSSL req format.
- Return type:
None