aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat/primitives/asymmetric/rsa.py
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-02-08 14:18:59 +0000
committerAlex Stapleton <alexs@prol.etari.at>2014-02-12 09:06:54 +0000
commitb232d7427650d4f217e3b28d51151c4cb625a764 (patch)
tree9a9da1d58715c0b0bacfb88259dc9ee21941a46e /cryptography/hazmat/primitives/asymmetric/rsa.py
parentb96d7968be429a2e4d13b9141ee6ad333ef1cf42 (diff)
downloadcryptography-b232d7427650d4f217e3b28d51151c4cb625a764.tar.gz
cryptography-b232d7427650d4f217e3b28d51151c4cb625a764.tar.bz2
cryptography-b232d7427650d4f217e3b28d51151c4cb625a764.zip
Add RSAPrivateKey.generate
Diffstat (limited to 'cryptography/hazmat/primitives/asymmetric/rsa.py')
-rw-r--r--cryptography/hazmat/primitives/asymmetric/rsa.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cryptography/hazmat/primitives/asymmetric/rsa.py b/cryptography/hazmat/primitives/asymmetric/rsa.py
index 1b33eaab..60c5c807 100644
--- a/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -109,6 +109,10 @@ class RSAPrivateKey(object):
self._public_exponent = public_exponent
self._modulus = modulus
+ @classmethod
+ def generate(self, public_exponent, key_size, backend):
+ return backend.generate_rsa_private_key(public_exponent, key_size)
+
@property
def key_size(self):
return _bit_length(self.modulus)