diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-02-25 20:58:19 -0800 | 
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2014-02-25 20:58:19 -0800 | 
| commit | d8c8f7cde6b43d08f39cd11cd2e2dd3ed7feb5a5 (patch) | |
| tree | f912b6b5d7bb466a05c7e802ffb6515716c87087 /tests/hazmat/backends/test_multibackend.py | |
| parent | 8bae14b62bc5da70ddfd9cd587f016b8d8a0425a (diff) | |
| parent | 572cb46dcca8d1b06f44ab2135f866002b3e32e2 (diff) | |
| download | cryptography-d8c8f7cde6b43d08f39cd11cd2e2dd3ed7feb5a5.tar.gz cryptography-d8c8f7cde6b43d08f39cd11cd2e2dd3ed7feb5a5.tar.bz2 cryptography-d8c8f7cde6b43d08f39cd11cd2e2dd3ed7feb5a5.zip | |
Merge pull request #673 from reaperhulk/rsa-pkcs1-signature-only
Add RSA PKCS1 signing (and structure for PSS + verification)
Diffstat (limited to 'tests/hazmat/backends/test_multibackend.py')
| -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..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()) | 
