aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-06 20:47:06 -0430
committerPaul Kehrer <paul.l.kehrer@gmail.com>2016-03-06 20:47:06 -0430
commita372db375a34b57fe8efba331b548247a3c42d1a (patch)
tree44dfb9dde90db993f6ed31e9306be719dbefa28b /tests/test_x509.py
parent40087ae7bde2b2455491f98a33c7fef580284ee5 (diff)
parentfbda8ce83d8aa774bbd5438dfd98def87585df3b (diff)
downloadcryptography-a372db375a34b57fe8efba331b548247a3c42d1a.tar.gz
cryptography-a372db375a34b57fe8efba331b548247a3c42d1a.tar.bz2
cryptography-a372db375a34b57fe8efba331b548247a3c42d1a.zip
Merge pull request #2670 from joernheissler/x509_req_verify
Add verify method on CertificateSigningRequest
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index 9054c4ed..c042169c 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -1241,6 +1241,22 @@ class TestRSACertificateRequest(object):
with pytest.raises(TypeError):
request.public_bytes('NotAnEncoding')
+ def test_signature_invalid(self, backend):
+ request = _load_cert(
+ os.path.join("x509", "requests", "invalid_signature.pem"),
+ x509.load_pem_x509_csr,
+ backend
+ )
+ assert not request.is_signature_valid
+
+ def test_signature_valid(self, backend):
+ request = _load_cert(
+ os.path.join("x509", "requests", "rsa_sha256.pem"),
+ x509.load_pem_x509_csr,
+ backend
+ )
+ assert request.is_signature_valid
+
@pytest.mark.parametrize(
("request_path", "loader_func", "encoding"),
[