From d50c1e92ac789d8912f257350fe3861fce9d1095 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Fri, 6 Jun 2014 17:43:49 -0500 Subject: add rsa_generate_private_key function to replace RSAPrivateKey.generate refs #1026. #1101 is dependent on this --- docs/hazmat/primitives/asymmetric/rsa.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'docs/hazmat/primitives') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 54839119..ff9b0a7b 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -7,13 +7,22 @@ RSA `RSA`_ is a `public-key`_ algorithm for encrypting and signing messages. + +.. function:: generate_rsa_private_key(public_exponent, key_size, backend) + + .. versionadded:: 0.5 + + Generate a provider of + :class:`~cryptography.hazmat.primitives.interfaces.RSAPrivateKey` + using ``backend``. + .. 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_rsa_private_key` to generate new keys. .. warning:: This method only checks a limited set of properties of its arguments. -- cgit v1.2.3 From 433e2a78dbafb210ddec13131b66bbb369e57d6d Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Fri, 6 Jun 2014 22:29:05 -0500 Subject: add some missing docs --- docs/hazmat/primitives/asymmetric/rsa.rst | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'docs/hazmat/primitives') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index ff9b0a7b..2056b010 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -12,9 +12,24 @@ RSA .. versionadded:: 0.5 - Generate a provider of - :class:`~cryptography.hazmat.primitives.interfaces.RSAPrivateKey` - using ``backend``. + 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) -- cgit v1.2.3 From 9412e28901e10bab7a458d5835b4557b67be3fb1 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 7 Jun 2014 13:18:59 -0500 Subject: rename the docs too. --- docs/hazmat/primitives/asymmetric/rsa.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/hazmat/primitives') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 2056b010..71b7cd9c 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -8,7 +8,7 @@ RSA `RSA`_ is a `public-key`_ algorithm for encrypting and signing messages. -.. function:: generate_rsa_private_key(public_exponent, key_size, backend) +.. function:: generate_private_key(public_exponent, key_size, backend) .. versionadded:: 0.5 @@ -37,7 +37,7 @@ RSA An RSA private key is required for decryption and signing of messages. - You should use :func:`generate_rsa_private_key` 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. -- cgit v1.2.3