diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-02-23 15:09:56 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-02-23 15:09:56 -0600 |
commit | dff1d43d0ae65da599eb60f99d411112b39fc8e9 (patch) | |
tree | 9ee18e09ac73a84855dc42b7188a3a8a21344b11 /tests/hazmat/backends | |
parent | a33df8ed655b507e72bdb4aab377dcf7a81954c5 (diff) | |
download | cryptography-dff1d43d0ae65da599eb60f99d411112b39fc8e9.tar.gz cryptography-dff1d43d0ae65da599eb60f99d411112b39fc8e9.tar.bz2 cryptography-dff1d43d0ae65da599eb60f99d411112b39fc8e9.zip |
add basic multibackend so we can do signatures using default_backend
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r-- | tests/hazmat/backends/test_multibackend.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index ce77ce2f..e3f83d3a 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -20,6 +20,7 @@ from cryptography.hazmat.backends.interfaces import ( ) from cryptography.hazmat.backends.multibackend import MultiBackend from cryptography.hazmat.primitives import hashes, hmac +from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes @@ -85,6 +86,9 @@ class DummyRSABackend(object): def generate_rsa_private_key(self, public_exponent, private_key): pass + def create_rsa_signature_ctx(self, private_key, padding, algorithm): + pass + class TestMultiBackend(object): def test_ciphers(self): @@ -158,6 +162,13 @@ class TestMultiBackend(object): key_size=1024, public_exponent=65537 ) + backend.create_rsa_signature_ctx("private_key", padding.PKCS1(), + hashes.MD5()) + backend = MultiBackend([]) with pytest.raises(UnsupportedAlgorithm): backend.generate_rsa_private_key(key_size=1024, public_exponent=3) + + with pytest.raises(UnsupportedAlgorithm): + backend.create_rsa_signature_ctx("private_key", padding.PKCS1(), + hashes.MD5()) |