hmac.HMAC

class hmac.HMAC(key, msg=None, digestmod=None)[source]

RFC 2104 HMAC class. Also complies with RFC 4231.

This supports the API for Cryptographic Hash Functions (PEP 247).

Methods

__init__(key[, msg, digestmod]) Create a new HMAC object.
_current() Return a hash object for the current state.
copy() Return a separate copy of this hashing object.
digest() Return the hash value of this hashing object.
hexdigest() Like digest(), but returns a string of hexadecimal digits instead.
update(msg) Update this hashing object with the string msg.

Attributes

blocksize