![]() |
Kea 3.1.1
|
#include <crypto_hmac.h>
Public Member Functions | |
~HMAC () | |
Destructor. | |
HashAlgorithm | getHashAlgorithm () const |
Returns the HashAlgorithm of the object. | |
size_t | getOutputLength () const |
Returns the output size of the digest. | |
void | sign (isc::util::OutputBuffer &result, size_t len) |
Calculate the final signature. | |
std::vector< uint8_t > | sign (size_t len) |
Calculate the final signature. | |
void | sign (void *result, size_t len) |
Calculate the final signature. | |
void | update (const void *data, const size_t len) |
Add data to digest. | |
bool | verify (const void *sig, size_t len) |
Verify an existing signature. | |
Friends | |
HMAC * | CryptoLink::createHMAC (const void *, size_t, const HashAlgorithm) |
HMAC support.
This class is used to create and verify HMAC signatures. Instances can be created with CryptoLink::createHMAC()
Definition at line 27 of file crypto_hmac.h.
isc::cryptolink::HMAC::~HMAC | ( | ) |
Destructor.
Definition at line 204 of file botan_hmac.cc.
HashAlgorithm isc::cryptolink::HMAC::getHashAlgorithm | ( | ) | const |
Returns the HashAlgorithm of the object.
Definition at line 209 of file botan_hmac.cc.
size_t isc::cryptolink::HMAC::getOutputLength | ( | ) | const |
Returns the output size of the digest.
Definition at line 214 of file botan_hmac.cc.
void isc::cryptolink::HMAC::sign | ( | isc::util::OutputBuffer & | result, |
size_t | len ) |
Calculate the final signature.
The result will be appended to the given outputbuffer
LibraryError | if there was any unexpected exception in the underlying library |
result | The OutputBuffer to append the result to |
len | The number of bytes from the result to copy. If this value is smaller than the algorithms output size, the result will be truncated. If this value is larger, only output size bytes will be copied |
Definition at line 224 of file botan_hmac.cc.
std::vector< uint8_t > isc::cryptolink::HMAC::sign | ( | size_t | len | ) |
Calculate the final signature.
The result will be returned as a std::vector<uint8_t>
LibraryError | if there was any unexpected exception in the underlying library |
len | The number of bytes from the result to copy. If this value is smaller than the algorithms output size, the result will be truncated. If this value is larger, only output size bytes will be copied |
Definition at line 234 of file botan_hmac.cc.
void isc::cryptolink::HMAC::sign | ( | void * | result, |
size_t | len ) |
Calculate the final signature.
len bytes of data from the result will be copied to *result If len is larger than the output size, only output_size bytes will be copied. If it is smaller, the output will be truncated
LibraryError | if there was any unexpected exception in the underlying library |
At least len bytes of data must be available for writing at result
Definition at line 229 of file botan_hmac.cc.
void isc::cryptolink::HMAC::update | ( | const void * | data, |
const size_t | len ) |
Add data to digest.
LibraryError | if there was any unexpected exception in the underlying library |
data | The data to add |
len | The size of the data |
Definition at line 219 of file botan_hmac.cc.
bool isc::cryptolink::HMAC::verify | ( | const void * | sig, |
size_t | len ) |
Verify an existing signature.
LibraryError | if there was any unexpected exception in the underlying library |
sig | The signature to verify |
len | The length of the signature. If this is smaller than the output length of the algorithm, only len bytes will be checked. If this is larger than the output length of the algorithm, only output size bytes will be checked |
Definition at line 239 of file botan_hmac.cc.
|
friend |