aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/hazmat/primitives/padding.rst35
-rw-r--r--docs/hazmat/primitives/symmetric-encryption.rst15
2 files changed, 41 insertions, 9 deletions
diff --git a/docs/hazmat/primitives/padding.rst b/docs/hazmat/primitives/padding.rst
index 995ed9f3..ebcc6104 100644
--- a/docs/hazmat/primitives/padding.rst
+++ b/docs/hazmat/primitives/padding.rst
@@ -8,6 +8,7 @@
Padding
=======
+.. currentmodule:: cryptography.hazmat.primitives.padding
Padding is a way to take data that may or may not be be a multiple of the block
size for a cipher and extend it out so that it is. This is required for many
@@ -15,7 +16,7 @@ block cipher modes as they require the data to be encrypted to be an exact
multiple of the block size.
-.. class:: cryptography.primitives.padding.PKCS7(block_size)
+.. class:: PKCS7(block_size)
PKCS7 padding is a generalization of PKCS5 padding (also known as standard
padding). PKCS7 padding works by appending ``N`` bytes with the value of
@@ -42,3 +43,35 @@ multiple of the block size.
:param data: The data that should be unpadded.
:rtype bytes: The unpadded data.
+
+ .. method:: padder()
+
+ :returns: A padding
+ :class:`~cryptography.hazmat.primitives.interfaces.PaddingContext`
+ provider.
+
+ .. method:: unpadder()
+
+ :returns: An unpadding
+ :class:`~cryptography.hazmat.primitives.interfaces.PaddingContext`
+ provider.
+
+
+.. currentmodule:: cryptography.hazmat.primitives.interfaces
+
+.. class:: PaddingContext
+
+ When calling ``padder()`` or ``unpadder()`` you will receive an a return
+ object conforming to the ``PaddingContext`` interface. You can then call
+ ``update(data)`` with data until you have fed everything into the context.
+ Once that is done call ``finalize()`` to finish the operation and obtain
+ the remainder of the data.
+
+ .. method:: update(data)
+
+ :param bytes data: The data you wish to pass into the context.
+ :return bytes: Returns the data that was padded or unpadded.
+
+ .. method:: finalize()
+
+ :return bytes: Returns the remainder of the data.
diff --git a/docs/hazmat/primitives/symmetric-encryption.rst b/docs/hazmat/primitives/symmetric-encryption.rst
index 758a4648..9a5bce07 100644
--- a/docs/hazmat/primitives/symmetric-encryption.rst
+++ b/docs/hazmat/primitives/symmetric-encryption.rst
@@ -54,18 +54,17 @@ where the encrypter and decrypter both use the same key.
.. currentmodule:: cryptography.hazmat.primitives.interfaces
-.. class:: CipherContext()
-
- When calling ``encryptor()`` or ``decryptor()`` on a BlockCipher object you
- will receive a return object conforming to the CipherContext interface. You
- can then call ``update(data)`` with data until you have fed everything into
- the context. Once that is done call ``finalize()`` to finish the operation and
- obtain the remainder of the data.
+.. class:: CipherContext
+ When calling ``encryptor()`` or ``decryptor()`` on a ``BlockCipher`` object
+ you will receive a return object conforming to the ``CipherContext``
+ interface. You can then call ``update(data)`` with data until you have fed
+ everything into the context. Once that is done call ``finalize()`` to
+ finish the operation and obtain the remainder of the data.
.. method:: update(data)
- :param bytes data: The text you wish to pass into the context.
+ :param bytes data: The data you wish to pass into the context.
:return bytes: Returns the data that was encrypted or decrypted.
.. method:: finalize()