Crypto::HmacContext< HashContext > Class Template Reference
HMAC class template. More...
#include <HmacContext.h>
Collaboration diagram for Crypto::HmacContext< HashContext >:
Public Types | |
using | Engine = typename HashContext::Engine |
using | Hash = typename HashContext::Hash |
Public Member Functions | |
HmacContext ()=default | |
Default HMAC constructor. More... | |
HmacContext (const Secret &key) | |
Initialise HMAC context with key. More... | |
HmacContext & | init (const Secret &key) |
Initialise HMAC with key. More... | |
template<typename... Ts> | |
HmacContext & | update (Ts &&... args) |
Update HMAC with some message content. More... | |
Hash | getHash () |
template<typename... Ts> | |
Hash | calculate (Ts &&... args) |
Calculate hash for some data. More... | |
Static Public Attributes | |
static constexpr size_t | blocksize = Engine::blocksize |
Detailed Description
template<class HashContext>
class Crypto::HmacContext< HashContext >
HMAC class template.
Implements the HMAC algorithm using any defined hash context
Member Typedef Documentation
◆ Engine
template<class HashContext >
using Crypto::HmacContext< HashContext >::Engine = typename HashContext::Engine |
◆ Hash
template<class HashContext >
using Crypto::HmacContext< HashContext >::Hash = typename HashContext::Hash |
Constructor & Destructor Documentation
◆ HmacContext() [1/2]
template<class HashContext >
|
default |
Default HMAC constructor.
Must call init() first.
◆ HmacContext() [2/2]
template<class HashContext >
|
inline |
Initialise HMAC context with key.
Member Function Documentation
◆ calculate()
template<class HashContext >
template<typename... Ts>
|
inline |
Calculate hash for some data.
Use like this:
auto hash = Crypto::HmacMd5(mySecret).calculate(myData);
- Parameters
-
args See HashContext update() methods
- Return values
-
Hash
◆ getHash()
template<class HashContext >
|
inline |
◆ init()
template<class HashContext >
|
inline |
Initialise HMAC with key.
- Return values
-
Reference to enable method chaining
◆ update()
template<class HashContext >
template<typename... Ts>
|
inline |
Update HMAC with some message content.
- Parameters
-
args See HashContext update() methods
- Return values
-
Reference to enable method chaining
Member Data Documentation
◆ blocksize
template<class HashContext >
|
static |
The documentation for this class was generated from the following file: