From 940eee2d7109b742a33612c1a1ff4f72e44c3d78 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Wed, 5 Feb 2014 20:25:30 +0000 Subject: RSA key docs --- docs/hazmat/primitives/rsa.rst | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/hazmat/primitives/rsa.rst (limited to 'docs/hazmat/primitives/rsa.rst') diff --git a/docs/hazmat/primitives/rsa.rst b/docs/hazmat/primitives/rsa.rst new file mode 100644 index 00000000..f79b9300 --- /dev/null +++ b/docs/hazmat/primitives/rsa.rst @@ -0,0 +1,51 @@ +.. hazmat:: + +RSA +=== + +.. currentmodule:: cryptography.hazmat.primitives.asymmetric.rsa + +`RSA`_ is a `public-key`_ algorithm for encrypting and signing messages. + +.. class:: RSAPrivateKey(p, q, private_exponent, public_exponent, modulus) + + .. versionadded:: 0.2 + + An RSA private key is required for decryption and signing of messages. + + Normally you do not need to directly construct private keys because you'll + be loading them from a file or generating them automatically. + + This class conforms to the + :class:`~cryptography.hazmat.primitives.interfaces.RSAPrivateKey` + interface. + + :raises TypeError: This is raised when the arguments are not all integers. + + :raises ValueError: This is raised when the values of `private_exponent`, + `public_exponent` or `modulus` do not match the bounds + specified in `RFC 3447`_ + +.. class:: RSAPublicKey(public_exponent, modulus) + + .. versionadded:: 0.2 + + An RSA public key is required for encryption and verification of messages. + + Normally you do not need to directly construct public keys because you'll + be loading them from a file, generating them automatically or receiving + them from a 3rd party. + + This class conforms to the + :class:`~cryptography.hazmat.primitives.interfaces.RSAPublicKey` + interface. + + :raises TypeError: This is raised when the arguments are not all integers. + + :raises ValueError: This is raised when the values of `public_exponent` or + `modulus` do not match the bounds specified in + `RFC 3447`_ + +.. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem) +.. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography +.. _`RFC 3447`: https://tools.ietf.org/html/rfc3447 -- cgit v1.2.3 From 4eaab17b738963335c76cfafafee44fef8203dee Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Thu, 6 Feb 2014 21:06:18 +0000 Subject: More sanity checks --- docs/hazmat/primitives/rsa.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/hazmat/primitives/rsa.rst') diff --git a/docs/hazmat/primitives/rsa.rst b/docs/hazmat/primitives/rsa.rst index f79b9300..3c509cf9 100644 --- a/docs/hazmat/primitives/rsa.rst +++ b/docs/hazmat/primitives/rsa.rst @@ -22,9 +22,9 @@ RSA :raises TypeError: This is raised when the arguments are not all integers. - :raises ValueError: This is raised when the values of `private_exponent`, - `public_exponent` or `modulus` do not match the bounds - specified in `RFC 3447`_ + :raises ValueError: This is raised when the values of `p`, `q`, + `private_exponent`, `public_exponent` or `modulus` do + not match the bounds specified in `RFC 3447`_. .. class:: RSAPublicKey(public_exponent, modulus) -- cgit v1.2.3 From be5da2d7e3a22904f93b56ab54df06d975588d8e Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Fri, 7 Feb 2014 08:15:39 +0000 Subject: Add warning about untrusted private keys --- docs/hazmat/primitives/rsa.rst | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/hazmat/primitives/rsa.rst') diff --git a/docs/hazmat/primitives/rsa.rst b/docs/hazmat/primitives/rsa.rst index 3c509cf9..d62aa101 100644 --- a/docs/hazmat/primitives/rsa.rst +++ b/docs/hazmat/primitives/rsa.rst @@ -16,6 +16,13 @@ RSA Normally you do not need to directly construct private keys because you'll be loading them from a file or generating them automatically. + .. warning:: + This method only checks a limited set of properties of its arguments. + Using an RSA that you do not trust or with incorrect parameters may + lead to insecure operation, crashes, and other undefined behavior. We + recommend that you only ever load private keys that were generated with + software you trust. + This class conforms to the :class:`~cryptography.hazmat.primitives.interfaces.RSAPrivateKey` interface. -- cgit v1.2.3 From f44b6a9d05342033874a62bada41b536f2133ca2 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Fri, 7 Feb 2014 18:28:47 +0000 Subject: . --- docs/hazmat/primitives/rsa.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/hazmat/primitives/rsa.rst') diff --git a/docs/hazmat/primitives/rsa.rst b/docs/hazmat/primitives/rsa.rst index d62aa101..7c6356c1 100644 --- a/docs/hazmat/primitives/rsa.rst +++ b/docs/hazmat/primitives/rsa.rst @@ -51,7 +51,7 @@ RSA :raises ValueError: This is raised when the values of `public_exponent` or `modulus` do not match the bounds specified in - `RFC 3447`_ + `RFC 3447`_. .. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem) .. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography -- cgit v1.2.3