aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-03-08 16:34:32 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-03-08 16:34:32 -0400
commit88e7ed6415ccf7fb2432b90876deefa8ab88cc98 (patch)
treef0d9d75696b461b6628d13b2e61c94ceff81e180 /tests/hazmat/backends/test_openssl.py
parent7d5483b7cd0065b1f21b068ac2278ba74c21dc67 (diff)
parentefc7f3d23836b7fd6633e95af0e2626eb1f594da (diff)
downloadcryptography-88e7ed6415ccf7fb2432b90876deefa8ab88cc98.tar.gz
cryptography-88e7ed6415ccf7fb2432b90876deefa8ab88cc98.tar.bz2
cryptography-88e7ed6415ccf7fb2432b90876deefa8ab88cc98.zip
Merge pull request #1706 from reaperhulk/serialize-rsa-public-key
Serialize RSA public keys
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r--tests/hazmat/backends/test_openssl.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 8ee9d246..ba0a2ba3 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -508,7 +508,7 @@ class TestRSAPEMSerialization(object):
serialization.BestAvailableEncryption(password)
)
- def test_unsupported_key_encoding(self):
+ def test_unsupported_private_key_encoding(self):
key = RSA_KEY_2048.private_key(backend)
with pytest.raises(ValueError):
key.private_bytes(
@@ -516,3 +516,11 @@ class TestRSAPEMSerialization(object):
serialization.PrivateFormat.PKCS8,
serialization.NoEncryption()
)
+
+ def test_unsupported_public_key_encoding(self):
+ key = RSA_KEY_2048.private_key(backend).public_key()
+ with pytest.raises(ValueError):
+ key.public_bytes(
+ serialization.Encoding.DER,
+ serialization.PublicFormat.SubjectPublicKeyInfo
+ )