aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_multibackend.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends/test_multibackend.py')
-rw-r--r--tests/hazmat/backends/test_multibackend.py11
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..be1e76e2 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.PKCS1v15(),
+ 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.PKCS1v15(),
+ hashes.MD5())