diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-28 11:31:06 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-03-07 19:59:04 -0600 |
commit | 3f157e00f4fe3a86da17a1de8e2222705147728f (patch) | |
tree | a458824de770f94c35285e103ad2591514147de2 /tests/hazmat/backends/test_openssl.py | |
parent | 7d5483b7cd0065b1f21b068ac2278ba74c21dc67 (diff) | |
download | cryptography-3f157e00f4fe3a86da17a1de8e2222705147728f.tar.gz cryptography-3f157e00f4fe3a86da17a1de8e2222705147728f.tar.bz2 cryptography-3f157e00f4fe3a86da17a1de8e2222705147728f.zip |
support RSA public key serialization
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 10 |
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 + ) |