From 2fc16f548c2a9e4e82ff1f42abd17583c0bcfb73 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Apr 2014 13:44:36 -0700 Subject: Most basic numbers documentation. --- docs/hazmat/primitives/asymmetric/rsa.rst | 66 +++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'docs/hazmat/primitives/asymmetric') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 68ad089d..d66a339a 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -329,6 +329,72 @@ RSA ) +.. class:: RSAPublicNumbers(e, n) + + .. versionadded:: 0.5 + + .. attribute:: n + + :type: int + + The public modulus. + + .. attribute:: e + + :type: int + + The public exponent. + + +.. class:: RSAPrivateNumbers(p, q, d, dmp1, dmq1, iqmp, public_numbers) + + .. versionadded:: 0.5 + + + .. method:: public_numbers() + + :return: :class:`~cryptography.hazmat.primitives.rsa.RSAPublicNumbers` + + .. attribute:: p + + :type: int + + ``p``, one of the two primes composing the :attr:`modulus`. + + .. attribute:: q + + :type: int + + ``q``, one of the two primes composing the :attr:`modulus`. + + .. attribute:: d + + :type: int + + The private exponent. Alias for :attr:`private_exponent`. + + .. attribute:: dmp1 + + :type: int + + A `Chinese remainder theorem`_ coefficient used to speed up RSA + operations. Calculated as: d mod (p-1) + + .. attribute:: dmq1 + + :type: int + + A `Chinese remainder theorem`_ coefficient used to speed up RSA + operations. Calculated as: d mod (q-1) + + .. attribute:: iqmp + + :type: int + + A `Chinese remainder theorem`_ coefficient used to speed up RSA + operations. Calculated as: q\ :sup:`-1` mod p + + Handling partial RSA private keys --------------------------------- -- cgit v1.2.3 From 716b6bc323e1bc1b39614ebaf880ae5c32102a3b Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Apr 2014 15:18:44 -0700 Subject: More RSA*Numbers documentation, gosh these descriptions are bad. --- docs/hazmat/primitives/asymmetric/rsa.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/hazmat/primitives/asymmetric') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index d66a339a..34e15a73 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -333,6 +333,9 @@ RSA .. versionadded:: 0.5 + An RSAPublicNumbers instance represents the constituent parts of an + RSA Public key as integers. + .. attribute:: n :type: int @@ -350,6 +353,8 @@ RSA .. versionadded:: 0.5 + An RSAPrivateNumbers instance represents the constituent parts of an + RSA Private key as integers. .. method:: public_numbers() -- cgit v1.2.3 From 483df727eee61d9ab9dcbcd534ff41559e819714 Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Apr 2014 15:50:26 -0700 Subject: Rewrite some descriptions to not be self-referential and rewrite the private numbers description to be a little bit scary. --- docs/hazmat/primitives/asymmetric/rsa.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'docs/hazmat/primitives/asymmetric') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 34e15a73..de7ad4bc 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -333,8 +333,7 @@ RSA .. versionadded:: 0.5 - An RSAPublicNumbers instance represents the constituent parts of an - RSA Public key as integers. + The colleciton of integers that make up an RSA public key. .. attribute:: n @@ -353,8 +352,15 @@ RSA .. versionadded:: 0.5 - An RSAPrivateNumbers instance represents the constituent parts of an - RSA Private key as integers. + The collection of integers that make up an RSA private key. + + .. warning:: + + With the exception of the integers contained in the + :class:`RSAPublicNumbers` returned by the :meth:`public_numbers` + method, all attributes of this class must be kept secret. Revealing + them will compromise the security of any cryptographic operations + performed with a key derived from them. .. method:: public_numbers() -- cgit v1.2.3 From 216d263a07d8e830e6fd3cee5617870d9a773b9f Mon Sep 17 00:00:00 2001 From: David Reid Date: Wed, 30 Apr 2014 15:59:48 -0700 Subject: Fix typos. --- docs/hazmat/primitives/asymmetric/rsa.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/hazmat/primitives/asymmetric') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index de7ad4bc..5e6037de 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -333,7 +333,7 @@ RSA .. versionadded:: 0.5 - The colleciton of integers that make up an RSA public key. + The collection of integers that make up an RSA public key. .. attribute:: n -- cgit v1.2.3 From 6994ff0da7076ab161c91bfa5df09290faf1cec4 Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 1 May 2014 12:57:35 -0700 Subject: Make public_numbers a property. --- docs/hazmat/primitives/asymmetric/rsa.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'docs/hazmat/primitives/asymmetric') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 5e6037de..8c34497e 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -357,14 +357,16 @@ RSA .. warning:: With the exception of the integers contained in the - :class:`RSAPublicNumbers` returned by the :meth:`public_numbers` - method, all attributes of this class must be kept secret. Revealing - them will compromise the security of any cryptographic operations - performed with a key derived from them. + :class:`RSAPublicNumbers` all attributes of this class must be kept + secret. Revealing them will compromise the security of any + cryptographic operations performed with a key loaded from them. - .. method:: public_numbers() + .. attribute:: public_numbers - :return: :class:`~cryptography.hazmat.primitives.rsa.RSAPublicNumbers` + :type: :class:`~cryptography.hazmat.primitives.rsa.RSAPublicNumbers` + + The :class:`RSAPublicNumbers` which makes up the RSA public key + associated with this RSA private key. .. attribute:: p -- cgit v1.2.3