diff options
author | David Reid <dreid@dreid.org> | 2013-11-06 11:12:45 -0800 |
---|---|---|
committer | David Reid <dreid@dreid.org> | 2013-11-20 09:50:18 -0800 |
commit | ef0fcf26c920c011948f078481739f4e2c31535f (patch) | |
tree | 24fa4b4603d77f24b6052fac5ce3b9337a685871 /docs/hazmat/primitives/hmac.rst | |
parent | 077e76e697ebf25aa9fd757f0ef1fd1251b7d408 (diff) | |
download | cryptography-ef0fcf26c920c011948f078481739f4e2c31535f.tar.gz cryptography-ef0fcf26c920c011948f078481739f4e2c31535f.tar.bz2 cryptography-ef0fcf26c920c011948f078481739f4e2c31535f.zip |
Add a default_backend and start updating docs.
Diffstat (limited to 'docs/hazmat/primitives/hmac.rst')
-rw-r--r-- | docs/hazmat/primitives/hmac.rst | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/hazmat/primitives/hmac.rst b/docs/hazmat/primitives/hmac.rst index cff2dbf1..7d87ca7e 100644 --- a/docs/hazmat/primitives/hmac.rst +++ b/docs/hazmat/primitives/hmac.rst @@ -15,7 +15,7 @@ message authentication codes using a cryptographic hash function coupled with a secret key. You can use an HMAC to verify integrity as well as authenticate a message. -.. class:: HMAC(key, algorithm) +.. class:: HMAC(key, algorithm, backend) HMAC objects take a ``key`` and a provider of :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm`. @@ -27,8 +27,9 @@ message. .. doctest:: + >>> from cryptography.hazmat.bindings import default_backend >>> from cryptography.hazmat.primitives import hashes, hmac - >>> h = hmac.HMAC(key, hashes.SHA256()) + >>> h = hmac.HMAC(key, hashes.SHA256(), default_backend()) >>> h.update(b"message to hash") >>> h.finalize() '#F\xdaI\x8b"e\xc4\xf1\xbb\x9a\x8fc\xff\xf5\xdex.\xbc\xcd/+\x8a\x86\x1d\x84\'\xc3\xa6\x1d\xd8J' |