diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-21 15:53:21 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-22 11:18:42 -0500 |
commit | 642a9793f36a91566583c3681b03a58ae93ed3a0 (patch) | |
tree | f9db39d1d045c041b39597dc22e220b5f9164026 /docs/hazmat | |
parent | 5186d69cdf8bf3fbed8a4fa6806cfe83a89424dc (diff) | |
download | cryptography-642a9793f36a91566583c3681b03a58ae93ed3a0.tar.gz cryptography-642a9793f36a91566583c3681b03a58ae93ed3a0.tar.bz2 cryptography-642a9793f36a91566583c3681b03a58ae93ed3a0.zip |
add OAEP decryption example in docs
Diffstat (limited to 'docs/hazmat')
-rw-r--r-- | docs/hazmat/primitives/asymmetric/rsa.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index cb8ce91a..862df635 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -154,6 +154,22 @@ RSA :class:`~cryptography.hazmat.primitives.asymmetric.padding.OAEP` it may also be raised for invalid label values. + .. code-block:: python + + from cryptography.hazmat.backends import default_backend + from cryptography.hazmat.primitives import hashes + from cryptography.hazmat.primitives.asymmetric import padding + + plaintext = private_key.decrypt( + ciphertext, + padding.OAEP( + mgf=padding.MGF1(algorithm=hashes.SHA1()), + algorithm=hashes.SHA1(), + label=None + ), + default_backend() + ) + .. class:: RSAPublicKey(public_exponent, modulus) |