Kea  2.1.7-git
isc::cryptolink::HMACImpl Class Reference

Botan implementation of HMAC. More...

Public Member Functions

 HMACImpl (const void *secret, size_t secret_len, const HashAlgorithm hash_algorithm)
 Constructor from a secret and a hash algorithm. More...
 
 HMACImpl (const void *secret, size_t secret_len, const HashAlgorithm hash_algorithm)
 Constructor from a secret and a hash algorithm. More...
 
 ~HMACImpl ()
 Destructor. More...
 
 ~HMACImpl ()
 Destructor. More...
 
HashAlgorithm getHashAlgorithm () const
 Returns the HashAlgorithm of the object. More...
 
HashAlgorithm getHashAlgorithm () const
 Returns the HashAlgorithm of the object. More...
 
size_t getOutputLength () const
 Returns the output size of the digest. More...
 
size_t getOutputLength () const
 Returns the output size of the digest. More...
 
void sign (isc::util::OutputBuffer &result, size_t len)
 Calculate the final signature. More...
 
void sign (void *result, size_t len)
 Calculate the final signature. More...
 
void sign (isc::util::OutputBuffer &result, size_t len)
 Calculate the final signature. More...
 
std::vector< uint8_t > sign (size_t len)
 Calculate the final signature. More...
 
void sign (void *result, size_t len)
 Calculate the final signature. More...
 
std::vector< uint8_t > sign (size_t len)
 Calculate the final signature. More...
 
void update (const void *data, const size_t len)
 Add data to digest. More...
 
void update (const void *data, const size_t len)
 Add data to digest. More...
 
bool verify (const void *sig, size_t len)
 Verify an existing signature. More...
 
bool verify (const void *sig, size_t len)
 Verify an existing signature. More...
 

Detailed Description

Botan implementation of HMAC.

OpenSSL implementation of HMAC.

Each method is the counterpart of the HMAC corresponding method.

Definition at line 24 of file botan_hmac.cc.

Constructor & Destructor Documentation

◆ HMACImpl() [1/2]

isc::cryptolink::HMACImpl::HMACImpl ( const void *  secret,
size_t  secret_len,
const HashAlgorithm  hash_algorithm 
)
inlineexplicit

Constructor from a secret and a hash algorithm.

See constructor of the isc::cryptolink::HMAC class for details.

Parameters
secretThe secret to sign with
secret_lenThe length of the secret
hash_algorithmThe hash algorithm

Definition at line 33 of file botan_hmac.cc.

References isc::cryptolink::btn::getHashAlgorithmName(), isc_throw, and isc::Exception::what().

Referenced by verify().

+ Here is the call graph for this function:

◆ ~HMACImpl() [1/2]

isc::cryptolink::HMACImpl::~HMACImpl ( )
inline

Destructor.

Definition at line 85 of file botan_hmac.cc.

◆ HMACImpl() [2/2]

isc::cryptolink::HMACImpl::HMACImpl ( const void *  secret,
size_t  secret_len,
const HashAlgorithm  hash_algorithm 
)
inlineexplicit

Constructor from a secret and a hash algorithm.

See constructor of the isc::cryptolink::HMAC class for details.

Parameters
secretThe secret to sign with
secret_lenThe length of the secret
hash_algorithmThe hash algorithm

Definition at line 36 of file openssl_hmac.cc.

References isc::cryptolink::ossl::getHashAlgorithm(), and isc_throw.

+ Here is the call graph for this function:

◆ ~HMACImpl() [2/2]

isc::cryptolink::HMACImpl::~HMACImpl ( )
inline

Destructor.

Definition at line 62 of file openssl_hmac.cc.

Member Function Documentation

◆ getHashAlgorithm() [1/2]

HashAlgorithm isc::cryptolink::HMACImpl::getHashAlgorithm ( ) const
inline

Returns the HashAlgorithm of the object.

Definition at line 70 of file openssl_hmac.cc.

◆ getHashAlgorithm() [2/2]

HashAlgorithm isc::cryptolink::HMACImpl::getHashAlgorithm ( ) const
inline

Returns the HashAlgorithm of the object.

Definition at line 89 of file botan_hmac.cc.

◆ getOutputLength() [1/2]

size_t isc::cryptolink::HMACImpl::getOutputLength ( ) const
inline

Returns the output size of the digest.

Returns
output size of the digest

Definition at line 77 of file openssl_hmac.cc.

References isc_throw.

◆ getOutputLength() [2/2]

size_t isc::cryptolink::HMACImpl::getOutputLength ( ) const
inline

Returns the output size of the digest.

Returns
output size of the digest

Definition at line 96 of file botan_hmac.cc.

Referenced by sign(), and verify().

◆ sign() [1/6]

void isc::cryptolink::HMACImpl::sign ( isc::util::OutputBuffer result,
size_t  len 
)
inline

Calculate the final signature.

See isc::cryptolink::HMAC::sign() for details.

Definition at line 99 of file openssl_hmac.cc.

References isc::cryptolink::digest(), getOutputLength(), isc_throw, and isc::util::OutputBuffer::writeData().

+ Here is the call graph for this function:

◆ sign() [2/6]

void isc::cryptolink::HMACImpl::sign ( isc::util::OutputBuffer result,
size_t  len 
)
inline

Calculate the final signature.

See isc::cryptolink::HMAC::sign() for details.

Definition at line 114 of file botan_hmac.cc.

References isc_throw, isc::Exception::what(), and isc::util::OutputBuffer::writeData().

+ Here is the call graph for this function:

◆ sign() [3/6]

void isc::cryptolink::HMACImpl::sign ( void *  result,
size_t  len 
)
inline

Calculate the final signature.

See isc::cryptolink::HMAC::sign() for details.

Definition at line 114 of file openssl_hmac.cc.

References isc::cryptolink::digest(), getOutputLength(), and isc_throw.

+ Here is the call graph for this function:

◆ sign() [4/6]

std::vector<uint8_t> isc::cryptolink::HMACImpl::sign ( size_t  len)
inline

◆ sign() [5/6]

void isc::cryptolink::HMACImpl::sign ( void *  result,
size_t  len 
)
inline

Calculate the final signature.

See isc::cryptolink::HMAC::sign() for details.

Definition at line 130 of file botan_hmac.cc.

References getOutputLength(), isc_throw, and isc::Exception::what().

+ Here is the call graph for this function:

◆ sign() [6/6]

std::vector<uint8_t> isc::cryptolink::HMACImpl::sign ( size_t  len)
inline

Calculate the final signature.

See isc::cryptolink::HMAC::sign() for details.

Definition at line 146 of file botan_hmac.cc.

References isc_throw, and isc::Exception::what().

+ Here is the call graph for this function:

◆ update() [1/2]

void isc::cryptolink::HMACImpl::update ( const void *  data,
const size_t  len 
)
inline

Add data to digest.

See isc::cryptolink::HMAC::update() for details.

Definition at line 88 of file openssl_hmac.cc.

References isc_throw.

◆ update() [2/2]

void isc::cryptolink::HMACImpl::update ( const void *  data,
const size_t  len 
)
inline

Add data to digest.

See isc::cryptolink::HMAC::update() for details.

Definition at line 103 of file botan_hmac.cc.

References isc_throw, and isc::Exception::what().

+ Here is the call graph for this function:

◆ verify() [1/2]

bool isc::cryptolink::HMACImpl::verify ( const void *  sig,
size_t  len 
)
inline

◆ verify() [2/2]

bool isc::cryptolink::HMACImpl::verify ( const void *  sig,
size_t  len 
)
inline

Verify an existing signature.

See isc::cryptolink::HMAC::verify() for details.

Definition at line 165 of file botan_hmac.cc.

References getOutputLength(), HMACImpl(), isc_throw, and isc::Exception::what().

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: