diff options
author | David Reid <dreid@dreid.org> | 2014-05-08 10:09:37 -0700 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2014-06-03 10:05:38 -0700 |
commit | 6bca12ffdac94bc3ad0865c27ead1f5e9bba5325 (patch) | |
tree | e3c4ebdca9b55391602f9c5aa52ac9377e824266 /tests/hazmat/backends | |
parent | eeb5fbc368d05de41121893a7c536fcc59a5a6bd (diff) | |
download | cryptography-6bca12ffdac94bc3ad0865c27ead1f5e9bba5325.tar.gz cryptography-6bca12ffdac94bc3ad0865c27ead1f5e9bba5325.tar.bz2 cryptography-6bca12ffdac94bc3ad0865c27ead1f5e9bba5325.zip |
Add load_rsa_numbers support to MultiBackend.
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r-- | tests/hazmat/backends/test_multibackend.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index 3fa364e2..d4c89be3 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -23,7 +23,7 @@ from cryptography.hazmat.backends.interfaces import ( ) from cryptography.hazmat.backends.multibackend import MultiBackend from cryptography.hazmat.primitives import cmac, hashes, hmac -from cryptography.hazmat.primitives.asymmetric import padding +from cryptography.hazmat.primitives.asymmetric import padding, rsa from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from ...utils import raises_unsupported_algorithm @@ -111,6 +111,8 @@ class DummyRSABackend(object): pass def encrypt_rsa(self, public_key, plaintext, padding): + + def load_rsa_numbers(self, numbers): pass @@ -236,6 +238,8 @@ class TestMultiBackend(object): backend.decrypt_rsa("private_key", "encrypted", padding.PKCS1v15()) + backend.load_rsa_numbers(rsa.RSAPublicNumbers(e=3, n=1)) + backend = MultiBackend([]) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM @@ -279,6 +283,11 @@ class TestMultiBackend(object): ): backend.decrypt_rsa("private_key", "encrypted", padding.PKCS1v15()) + with raises_unsupported_algorithm( + _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM + ): + backend.load_rsa_numbers(rsa.RSAPublicNumbers(e=3, n=1)) + def test_dsa(self): backend = MultiBackend([ DummyDSABackend() |