blob: f79b930098698ea6e4203c27186628be7aff7b76 [file] [log] [blame]
Alex Stapleton940eee22014-02-05 20:25:30 +00001.. hazmat::
2
3RSA
4===
5
6.. currentmodule:: cryptography.hazmat.primitives.asymmetric.rsa
7
8`RSA`_ is a `public-key`_ algorithm for encrypting and signing messages.
9
10.. class:: RSAPrivateKey(p, q, private_exponent, public_exponent, modulus)
11
12 .. versionadded:: 0.2
13
14 An RSA private key is required for decryption and signing of messages.
15
16 Normally you do not need to directly construct private keys because you'll
17 be loading them from a file or generating them automatically.
18
19 This class conforms to the
20 :class:`~cryptography.hazmat.primitives.interfaces.RSAPrivateKey`
21 interface.
22
23 :raises TypeError: This is raised when the arguments are not all integers.
24
25 :raises ValueError: This is raised when the values of `private_exponent`,
26 `public_exponent` or `modulus` do not match the bounds
27 specified in `RFC 3447`_
28
29.. class:: RSAPublicKey(public_exponent, modulus)
30
31 .. versionadded:: 0.2
32
33 An RSA public key is required for encryption and verification of messages.
34
35 Normally you do not need to directly construct public keys because you'll
36 be loading them from a file, generating them automatically or receiving
37 them from a 3rd party.
38
39 This class conforms to the
40 :class:`~cryptography.hazmat.primitives.interfaces.RSAPublicKey`
41 interface.
42
43 :raises TypeError: This is raised when the arguments are not all integers.
44
45 :raises ValueError: This is raised when the values of `public_exponent` or
46 `modulus` do not match the bounds specified in
47 `RFC 3447`_
48
49.. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
50.. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography
51.. _`RFC 3447`: https://tools.ietf.org/html/rfc3447