aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-12-27 08:21:54 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-12-27 08:21:54 -0800
commit37c88a0dea800b3028f95bf71a8cd6e344254d4e (patch)
treebcf227588c0a96073336041978880763ce03bc7e /docs
parentb645521e84026633f666aa107816ac2fc5e05cc6 (diff)
parentb808f8cc91e302d4120eefa80c946a7cdcf9a155 (diff)
downloadcryptography-37c88a0dea800b3028f95bf71a8cd6e344254d4e.tar.gz
cryptography-37c88a0dea800b3028f95bf71a8cd6e344254d4e.tar.bz2
cryptography-37c88a0dea800b3028f95bf71a8cd6e344254d4e.zip
Merge pull request #315 from juliankrause/verify
Add verify function to hmac and hashes.
Diffstat (limited to 'docs')
-rw-r--r--docs/exceptions.rst6
-rw-r--r--docs/hazmat/primitives/hmac.rst8
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/exceptions.rst b/docs/exceptions.rst
index 087066b8..1fbd3267 100644
--- a/docs/exceptions.rst
+++ b/docs/exceptions.rst
@@ -8,6 +8,12 @@ Exceptions
This is raised when a context is used after being finalized.
+.. class:: InvalidSignature
+
+ This is raised when the verify method of a hash context does not
+ compare equal.
+
+
.. class:: NotYetFinalized
This is raised when the AEAD tag property is accessed on a context
diff --git a/docs/hazmat/primitives/hmac.rst b/docs/hazmat/primitives/hmac.rst
index 0547b7d2..b8f94fd2 100644
--- a/docs/hazmat/primitives/hmac.rst
+++ b/docs/hazmat/primitives/hmac.rst
@@ -71,3 +71,11 @@ message.
:return bytes: The message digest as bytes.
:raises cryptography.exceptions.AlreadyFinalized:
+
+ .. method:: verify(signature)
+
+ Finalize the current context and securely compare digest to ``signature``.
+
+ :param bytes signature: The bytes of the HMAC signature recieved.
+ :raises cryptography.exceptions.AlreadyFinalized: See :meth:`finalize`
+ :raises cryptography.exceptions.InvalidSignature: If signature does not match digest