aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-13 13:26:24 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-13 13:26:24 -0800
commitc2cddd2b1f0bd935ed53ee49446e268d9bf874e7 (patch)
tree5ab21f260a23d74145662ece1c5c1b3917e28d63 /docs/hazmat/primitives
parente0c1fe9991cb1e428d5179994940726baae899a0 (diff)
parent00fb12ae9d453e1c6db6a046ebf1f68000b44377 (diff)
downloadcryptography-c2cddd2b1f0bd935ed53ee49446e268d9bf874e7.tar.gz
cryptography-c2cddd2b1f0bd935ed53ee49446e268d9bf874e7.tar.bz2
cryptography-c2cddd2b1f0bd935ed53ee49446e268d9bf874e7.zip
Merge pull request #253 from dreid/hash-raise-after-finalize
raise an exception if you try to use a HashContext after finalize is called.
Diffstat (limited to 'docs/hazmat/primitives')
-rw-r--r--docs/hazmat/primitives/cryptographic-hashes.rst13
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/hazmat/primitives/cryptographic-hashes.rst b/docs/hazmat/primitives/cryptographic-hashes.rst
index e7b4f2d6..525fd889 100644
--- a/docs/hazmat/primitives/cryptographic-hashes.rst
+++ b/docs/hazmat/primitives/cryptographic-hashes.rst
@@ -36,16 +36,25 @@ Message Digests
.. method:: update(data)
:param bytes data: The bytes you wish to hash.
+ :raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
.. method:: copy()
- :return: a new instance of this object with a copied internal state.
+ Copy this :class:`Hash` instance, usually so that we may call
+ :meth:`finalize` and get an intermediate digest value while we continue
+ to call :meth:`update` on the original.
+
+ :return: A new instance of :class:`Hash` which can be updated
+ and finalized independently of the original instance.
+ :raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
.. method:: finalize()
Finalize the current context and return the message digest as bytes.
- Once ``finalize`` is called this object can no longer be used.
+ Once ``finalize`` is called this object can no longer be used and
+ :meth:`update` and :meth:`copy` will raise
+ :class:`~cryptography.exceptions.AlreadyFinalized`.
:return bytes: The message digest as bytes.