diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-24 12:12:28 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-24 16:41:44 -0500 |
commit | c84b3fb5e150ad1d6a1a5f40b80d392461448665 (patch) | |
tree | f87787c917b7995bfa19861748dfd81cc7805ef7 /docs/hazmat | |
parent | 4721d6367d6dd648ebf9ba6eef5a90fd0ee2f69b (diff) | |
download | cryptography-c84b3fb5e150ad1d6a1a5f40b80d392461448665.tar.gz cryptography-c84b3fb5e150ad1d6a1a5f40b80d392461448665.tar.bz2 cryptography-c84b3fb5e150ad1d6a1a5f40b80d392461448665.zip |
change doctest to codeblock until we add multibackend support for encrypt
Diffstat (limited to 'docs/hazmat')
-rw-r--r-- | docs/hazmat/primitives/asymmetric/rsa.rst | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index b0440695..ed0e1008 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -305,27 +305,27 @@ RSA :class:`~cryptography.hazmat.primitives.asymmetric.padding.OAEP` it may also be raised for invalid label values. - .. doctest:: + .. code-block:: python from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding, rsa - >>> private_key = rsa.RSAPrivateKey.generate( - ... public_exponent=65537, - ... key_size=2048, - ... backend=default_backend() - ... ) - >>> public_key = private_key.public_key() - >>> ciphertext = public_key.encrypt( - >>> plaintext, - >>> padding.OAEP( - >>> mgf=padding.MGF1(algorithm=hashes.SHA1()), - >>> algorithm=hashes.SHA1(), - >>> label=None - >>> ), - >>> default_backend() - >>> ) + private_key = rsa.RSAPrivateKey.generate( + public_exponent=65537, + key_size=2048, + backend=default_backend() + ) + public_key = private_key.public_key() + ciphertext = public_key.encrypt( + plaintext, + padding.OAEP( + mgf=padding.MGF1(algorithm=hashes.SHA1()), + algorithm=hashes.SHA1(), + label=None + ), + default_backend() + ) Handling partial RSA private keys |