Kea 2.7.5
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.
 
 HMACImpl (const void *secret, size_t secret_len, const HashAlgorithm hash_algorithm)
 Constructor from a secret and a hash algorithm.
 
 ~HMACImpl ()
 Destructor.
 
 ~HMACImpl ()=default
 Destructor.
 
HashAlgorithm getHashAlgorithm () const
 Returns the HashAlgorithm of the object.
 
HashAlgorithm getHashAlgorithm () const
 Returns the HashAlgorithm of the object.
 
size_t getOutputLength () const
 Returns the output size of the digest.
 
size_t getOutputLength () const
 Returns the output size of the digest.
 
void sign (isc::util::OutputBuffer &result, size_t len)
 Calculate the final signature.
 
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.
 
std::vector< uint8_t > sign (size_t len)
 Calculate the final signature.
 
void sign (void *result, 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.
 
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.
 
bool verify (const void *sig, size_t len)
 Verify an existing signature.
 

Detailed Description

Botan implementation of HMAC.

OpenSSL implementation of HMAC.

Each method is the counterpart of the HMAC corresponding method.

Definition at line 45 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 54 of file botan_hmac.cc.

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

+ Here is the call graph for this function:

◆ ~HMACImpl() [1/2]

isc::cryptolink::HMACImpl::~HMACImpl ( )
default

Destructor.

◆ 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 37 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 74 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 88 of file botan_hmac.cc.

Referenced by isc::cryptolink::HMAC::getHashAlgorithm().

◆ getHashAlgorithm() [2/2]

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

Returns the HashAlgorithm of the object.

Definition at line 82 of file openssl_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 95 of file botan_hmac.cc.

Referenced by isc::cryptolink::HMAC::getOutputLength(), sign(), sign(), sign(), and verify().

◆ 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 89 of file openssl_hmac.cc.

◆ 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 113 of file botan_hmac.cc.

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

Referenced by isc::cryptolink::HMAC::sign(), isc::cryptolink::HMAC::sign(), and isc::cryptolink::HMAC::sign().

+ 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 109 of file openssl_hmac.cc.

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

+ Here is the call graph for this function:

◆ sign() [3/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 145 of file botan_hmac.cc.

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

+ Here is the call graph for this function:

◆ sign() [4/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 147 of file openssl_hmac.cc.

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

+ Here is the call graph for this function:

◆ 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 129 of file botan_hmac.cc.

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

+ Here is the call graph for this function:

◆ sign() [6/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 128 of file openssl_hmac.cc.

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

+ 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 102 of file botan_hmac.cc.

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

Referenced by isc::cryptolink::HMAC::update().

+ Here is the call graph for this function:

◆ 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 96 of file openssl_hmac.cc.

References isc_throw.

◆ verify() [1/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 164 of file botan_hmac.cc.

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

Referenced by isc::cryptolink::HMAC::verify().

+ Here is the call graph for this function:

◆ 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 166 of file openssl_hmac.cc.

References getOutputLength(), and isc_throw.

+ Here is the call graph for this function:

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