aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat/primitives/mac/hmac.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/hazmat/primitives/mac/hmac.rst')
-rw-r--r--docs/hazmat/primitives/mac/hmac.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/hazmat/primitives/mac/hmac.rst b/docs/hazmat/primitives/mac/hmac.rst
index d56927b9..9ce49c8d 100644
--- a/docs/hazmat/primitives/mac/hmac.rst
+++ b/docs/hazmat/primitives/mac/hmac.rst
@@ -45,8 +45,10 @@ of a message.
To check that a given signature is correct use the :meth:`verify` method.
You will receive an exception if the signature is wrong:
- .. code-block:: pycon
+ .. doctest::
+ >>> h = hmac.HMAC(key, hashes.SHA256(), backend=default_backend())
+ >>> h.update(b"message to hash")
>>> h.verify(b"an incorrect signature")
Traceback (most recent call last):
...