From 27f9ca663def6fdccd97297ef40c55923a43394a Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 15 Apr 2014 17:59:27 -0400 Subject: more docs --- docs/hazmat/primitives/asymmetric/rsa.rst | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'docs/hazmat/primitives/asymmetric/rsa.rst') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index c9de2831..e72e8835 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -116,6 +116,39 @@ RSA :raises ValueError: This is raised when the chosen hash algorithm is too large for the key size. + .. method:: decrypt(ciphertext, padding, backend) + + .. versionadded:: 0.4 + + Decrypt data that was encrypted via the public key. + + :param bytes ciphertext: The ciphertext to decrypt. + + :param padding: An instance of a + :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricPadding` + provider. + + :param backend: A + :class:`~cryptography.hazmat.backends.interfaces.RSABackend` + provider. + + :return bytes: Decrypted data. + + :raises cryptography.exceptions.UnsupportedAlgorithm: This is raised if + the provided ``backend`` does not implement + :class:`~cryptography.hazmat.backends.interfaces.RSABackend` or if + the backend does not support the chosen hash or padding algorithm. + + :raises TypeError: This is raised when the padding is not an + :class:`~cryptography.hazmat.primitives.interfaces.AsymmetricPadding` + provider. + + :raises ValueError: This is raised when the chosen hash algorithm is + too large for the key size. + + :raises cryptography.exceptions.InvalidDecryption: This is raised if + decryption fails due to invalid ciphertext. + .. class:: RSAPublicKey(public_exponent, modulus) -- cgit v1.2.3