aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-12 10:07:44 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-12 10:07:44 -0800
commit0d22bf4a20433916dfb11a1f2aba9182ccbe0f5f (patch)
treedda0db9a3b7e6ed071e78d5b6612d16636ad1220 /cryptography
parentd0f37ea8da57daf9f4f9d60490d1aa3c41dd8845 (diff)
downloadcryptography-0d22bf4a20433916dfb11a1f2aba9182ccbe0f5f.tar.gz
cryptography-0d22bf4a20433916dfb11a1f2aba9182ccbe0f5f.tar.bz2
cryptography-0d22bf4a20433916dfb11a1f2aba9182ccbe0f5f.zip
Added RSABackend to MultiBackend
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/hazmat/backends/multibackend.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cryptography/hazmat/backends/multibackend.py b/cryptography/hazmat/backends/multibackend.py
index 49a4014d..4de02026 100644
--- a/cryptography/hazmat/backends/multibackend.py
+++ b/cryptography/hazmat/backends/multibackend.py
@@ -16,7 +16,7 @@ from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.backends.interfaces import (
- CipherBackend, HashBackend, HMACBackend, PBKDF2HMACBackend
+ CipherBackend, HashBackend, HMACBackend, PBKDF2HMACBackend, RSABackend
)
@@ -101,3 +101,8 @@ class MultiBackend(object):
except UnsupportedAlgorithm:
pass
raise UnsupportedAlgorithm
+
+ def generate_rsa_private_key(self, public_exponent, key_size):
+ for b in self._filtered_backends(RSABackend):
+ return b.generate_rsa_private_key(public_exponent, key_size)
+ raise UnsupportedAlgorithm