HMAC-SHA256 secret key.
More...
#include <hmac.hpp>
Inherits ndnph::detail::NamedPublicKey< SigType::HmacWithSha256 >, and ndnph::detail::NamedPrivateKey< SigType::HmacWithSha256 >.
◆ getMaxSigLen()
size_t ndnph::HmacKey::getMaxSigLen |
( |
| ) |
const |
|
inlinefinalvirtual |
◆ import()
bool ndnph::HmacKey::import |
( |
const uint8_t * |
key, |
|
|
size_t |
keyLen |
|
) |
| |
|
inline |
Import raw secret key bits.
- Parameters
-
key | raw key bits; will be copied if necessary. |
keyLen | key length in octets. |
- Returns
- whether success.
◆ operator bool()
ndnph::HmacKey::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Determine if this key is non-empty.
◆ sign()
ssize_t ndnph::HmacKey::sign |
( |
std::initializer_list< tlv::Value > |
chunks, |
|
|
uint8_t * |
sig |
|
) |
| const |
|
inlinefinalvirtual |
Perform signing.
- Parameters
-
| chunks | signed portion. |
[out] | sig | signature buffer, with getMaxSigLen() room. |
- Returns
- signature length, or -1 upon failure.
Implements ndnph::PrivateKey.
◆ verify()
bool ndnph::HmacKey::verify |
( |
std::initializer_list< tlv::Value > |
chunks, |
|
|
const uint8_t * |
sig, |
|
|
size_t |
sigLen |
|
) |
| const |
|
inlinefinalvirtual |
Perform verification.
- Return values
-
true | signature is correct. |
false | error or signature is incorrect. |
Implements ndnph::PublicKey.
The documentation for this class was generated from the following file:
- /home/runner/work/esp8266ndn/NDNph/src/ndnph/keychain/hmac.hpp