#include <WinCAPICryptoHashHMAC.hpp>
Inheritance diagram for WinCAPICryptoHashHMAC:
Uses the Windows Crypt* API functions to implement an HMAC.
Unfortunately the Windows Crypto API does not allow callers to enter an HMAC key directly. It relies on a seed being entered into a digest function that is then used to derive a key that can be used in an HMAC function.
Two types of key can therefore be used - a direct Windows key, or a "standard" string as the HMAC key. In the latter case, the HMAC function is implemented internally around a standard Windows hash function. In the former case, the Windows HMAC functions are used. (The latter case is mainly for interoperability testing, where the key is provided and needs to be entered "as is".
Public Member Functions | |
Constructors and Destructors | |
WinCAPICryptoHashHMAC (HCRYPTPROV prov, XSECCryptoHash::HashType alg) | |
Constructor. | |
virtual | ~WinCAPICryptoHashHMAC () |
HMAC Functions | |
virtual void | setKey (XSECCryptoKey *key) |
Set the HMAC key. | |
Hash functions | |
virtual void | reset (void) |
Reset the hash function. | |
virtual void | hash (unsigned char *data, unsigned int length) |
Hash some data. | |
virtual unsigned int | finish (unsigned char *hash, unsigned int maxLength) |
Finish up a Digest operation and read the result. | |
Information functions | |
virtual HashType | getHashType (void) |
|
Constructor. Create the object, with the indicated algorithm (Currently supports MD5 and SHA1)
|
|
|
|
Finish up a Digest operation and read the result. This call tells the CryptoHash object that the input is complete and to finalise the Digest. The output of the digest is read into the hash buffer (at most maxLength bytes). This is effectively the signature for the data that has been run through the HMAC function.
Implements XSECCryptoHash. |
|
Determine the hash type of this object
Implements XSECCryptoHash. |
|
Hash some data. Take length bytes of data from the data buffer and update the hash that already exists. This function may (and normally will) be called many times for large blocks of data.
Implements XSECCryptoHash. |
|
Reset the hash function. Re-initialises the digest structure. Implements XSECCryptoHash. |
|
Set the HMAC key. Sets the key - which needs to have a base class of WinCAPICryptoKeyHMAC.
Implements XSECCryptoHash. |