diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_x509.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py index 99551eb2..53052196 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -856,6 +856,20 @@ class TestCertificateSigningRequestBuilder(object): critical=False, ) + def test_add_unsupported_extension_in_backend(self, backend): + private_key = RSA_KEY_2048.private_key(backend) + builder = x509.CertificateSigningRequestBuilder() + builder = builder.subject_name( + x509.Name([ + x509.NameAttribute(x509.OID_COUNTRY_NAME, u'US'), + ]) + ).add_extension( + x509.SubjectAlternativeName([x509.DNSName(u"cryptography.io")]), + critical=False, + ) + with pytest.raises(NotImplementedError): + builder.sign(backend, private_key, hashes.SHA256()) + def test_set_subject_twice(self): builder = x509.CertificateSigningRequestBuilder() builder = builder.subject_name( |