From 223a8f02a37a87b3c7366441647013cf9a18b061 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 28 Feb 2015 18:54:10 -0600 Subject: change as_bytes to private_bytes, link more things --- docs/hazmat/primitives/asymmetric/rsa.rst | 8 ++++---- docs/hazmat/primitives/asymmetric/serialization.rst | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'docs/hazmat') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index adb5cbfc..924696db 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -86,13 +86,13 @@ Key serialization If you have a key that you've loaded or generated which implements the :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization` interface you can use -:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.as_bytes` +:meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.private_bytes` to serialize the key. .. doctest:: >>> from cryptography.hazmat.primitives import serialization - >>> pem = private_key.as_bytes( + >>> pem = private_key.private_bytes( ... encoding=serialization.Encoding.PEM, ... format=serialization.Format.PKCS8, ... encryption_algorithm=serialization.BestAvailableEncryption(b'mypassword') @@ -105,7 +105,7 @@ It is also possible to serialize without encryption using .. doctest:: - >>> pem = private_key.as_bytes( + >>> pem = private_key.private_bytes( ... encoding=serialization.Encoding.PEM, ... format=serialization.Format.TraditionalOpenSSL, ... encryption_algorithm=serialization.NoEncryption() @@ -534,7 +534,7 @@ Key interfaces :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers` instance. - .. method:: as_bytes(encoding, format, encryption_algorithm) + .. method:: private_bytes(encoding, format, encryption_algorithm) Allows serialization of the key to bytes. Encoding ( :attr:`~cryptography.hazmat.primitives.serialization.Encoding.PEM` or diff --git a/docs/hazmat/primitives/asymmetric/serialization.rst b/docs/hazmat/primitives/asymmetric/serialization.rst index 36ba241b..4940ebd4 100644 --- a/docs/hazmat/primitives/asymmetric/serialization.rst +++ b/docs/hazmat/primitives/asymmetric/serialization.rst @@ -290,7 +290,8 @@ Serialization Formats .. versionadded:: 0.8 - An enumeration for key formats. + An enumeration for key formats. Used with + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.private_bytes`. .. attribute:: TraditionalOpenSSL @@ -310,7 +311,8 @@ Serialization Encodings .. versionadded:: 0.8 - An enumeration for encoding types. + An enumeration for encoding types. Used with + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.private_bytes`. .. attribute:: PEM @@ -328,9 +330,10 @@ Serialization Encryption Types Objects with this interface are usable as encryption types with methods like - :meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.as_bytes`. + :meth:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.private_bytes`. All other classes in this section represent the available choices for - encryption and have this interface. + encryption and have this interface. They are used with + :class:`~cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.private_bytes`. .. class:: BestAvailableEncryption(password) -- cgit v1.2.3