aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2014-06-07 21:10:12 +0100
committerAlex Stapleton <alexs@prol.etari.at>2014-06-07 21:10:12 +0100
commitd4ae6c616289439501c0745f052cbeebd82bef70 (patch)
tree96c139b56b2eb6a6f92a1b999024980ee4b5eec1 /docs
parente80022489fd0027c7d99ada9e14c810cb5ca5e05 (diff)
parent9412e28901e10bab7a458d5835b4557b67be3fb1 (diff)
downloadcryptography-d4ae6c616289439501c0745f052cbeebd82bef70.tar.gz
cryptography-d4ae6c616289439501c0745f052cbeebd82bef70.tar.bz2
cryptography-d4ae6c616289439501c0745f052cbeebd82bef70.zip
Merge pull request #1102 from reaperhulk/rsa-generate-function
add rsa_generate_private_key function to replace RSAPrivateKey.generate
Diffstat (limited to 'docs')
-rw-r--r--docs/hazmat/primitives/asymmetric/rsa.rst26
1 files changed, 25 insertions, 1 deletions
diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst
index 54839119..71b7cd9c 100644
--- a/docs/hazmat/primitives/asymmetric/rsa.rst
+++ b/docs/hazmat/primitives/asymmetric/rsa.rst
@@ -7,13 +7,37 @@ RSA
`RSA`_ is a `public-key`_ algorithm for encrypting and signing messages.
+
+.. function:: generate_private_key(public_exponent, key_size, backend)
+
+ .. versionadded:: 0.5
+
+ Generate an RSA private key using the provided ``backend``.
+
+ :param int public_exponent: The public exponent of the new key.
+ Usually one of the small Fermat primes 3, 5, 17, 257, 65537. If in
+ doubt you should `use 65537`_.
+ :param int key_size: The length of the modulus in bits. For keys
+ generated in 2014 it is strongly recommended to be
+ `at least 2048`_ (See page 41). It must not be less than 512.
+ Some backends may have additional limitations.
+ :param backend: A
+ :class:`~cryptography.hazmat.backends.interfaces.RSABackend`
+ provider.
+ :return: A :class:`~cryptography.hazmat.primitives.interfaces.RSAPrivateKey`
+ provider.
+
+ :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if
+ the provided ``backend`` does not implement
+ :class:`~cryptography.hazmat.backends.interfaces.RSABackend`
+
.. class:: RSAPrivateKey(p, q, private_exponent, dmp1, dmq1, iqmp, public_exponent, modulus)
.. versionadded:: 0.2
An RSA private key is required for decryption and signing of messages.
- You should use :meth:`~generate` to generate new keys.
+ You should use :func:`generate_private_key` to generate new keys.
.. warning::
This method only checks a limited set of properties of its arguments.