12#include <boost/scoped_ptr.hpp>
20signHMAC(
const void* data,
const size_t data_len,
const void* secret,
24 boost::scoped_ptr<HMAC> hmac(
28 hmac->update(data, data_len);
30 len = hmac->getOutputLength();
32 hmac->sign(result, len);
37verifyHMAC(
const void* data,
const size_t data_len,
const void* secret,
39 const void* sig,
const size_t sig_len)
41 boost::scoped_ptr<HMAC> hmac(
45 hmac->update(data, data_len);
48 len = hmac->getOutputLength();
50 return (hmac->verify(sig, len));
static CryptoLink & getCryptoLink()
Returns a reference to the singleton instance.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
bool verifyHMAC(const void *data, const size_t data_len, const void *secret, size_t secret_len, const HashAlgorithm hash_algorithm, const void *sig, const size_t sig_len)
Verify an HMAC signature for the given data.
HashAlgorithm
Hash algorithm identifiers.
void signHMAC(const void *data, const size_t data_len, const void *secret, size_t secret_len, const HashAlgorithm hash_algorithm, isc::util::OutputBuffer &result, size_t len)
Create an HMAC signature for the given data.
void deleteHMAC(HMAC *hmac)
Delete an HMAC object.
Defines the logger used by the top-level component of kea-lfc.