Kea 2.7.5
isc::cryptolink::Hash Class Reference

Hash support. More...

#include <crypto_hash.h>

+ Inheritance diagram for isc::cryptolink::Hash:

Public Member Functions

 ~Hash ()
 Destructor.
 
void final (isc::util::OutputBuffer &result, size_t len)
 Calculate the final digest.
 
std::vector< uint8_t > final (size_t len)
 Calculate the final digest.
 
void final (void *result, size_t len)
 Calculate the final digest.
 
HashAlgorithm getHashAlgorithm () const
 Returns the HashAlgorithm of the object.
 
size_t getOutputLength () const
 Returns the output size of the digest.
 
void update (const void *data, const size_t len)
 Add data to digest.
 

Friends

HashCryptoLink::createHash (const HashAlgorithm)
 

Detailed Description

Hash support.

This class is used to create Hash digests. Instances can be created with CryptoLink::createHash()

Definition at line 27 of file crypto_hash.h.

Constructor & Destructor Documentation

◆ ~Hash()

isc::cryptolink::Hash::~Hash ( )

Destructor.

Definition at line 160 of file botan_hash.cc.

Member Function Documentation

◆ final() [1/3]

void isc::cryptolink::Hash::final ( isc::util::OutputBuffer & result,
size_t len )

Calculate the final digest.

The result will be appended to the given outputbuffer

Exceptions
LibraryErrorif there was any unexpected exception in the underlying library
Parameters
resultThe OutputBuffer to append the result to
lenThe 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 180 of file botan_hash.cc.

References isc::cryptolink::HashImpl::final().

+ Here is the call graph for this function:

◆ final() [2/3]

std::vector< uint8_t > isc::cryptolink::Hash::final ( size_t len)

Calculate the final digest.

The result will be returned as a std::vector<uint8_t>

Exceptions
LibraryErrorif there was any unexpected exception in the underlying library
Parameters
lenThe 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
Returns
a vector containing the signature

Definition at line 190 of file botan_hash.cc.

References isc::cryptolink::HashImpl::final().

+ Here is the call graph for this function:

◆ final() [3/3]

void isc::cryptolink::Hash::final ( void * result,
size_t len )

Calculate the final digest.

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

Exceptions
LibraryErrorif there was any unexpected exception in the underlying library

At least len bytes of data must be available for writing at result.

Parameters
resultThe memory location the digest will be written to
lenSpecifies the size of the result location available

Definition at line 185 of file botan_hash.cc.

References isc::cryptolink::HashImpl::final().

+ Here is the call graph for this function:

◆ getHashAlgorithm()

HashAlgorithm isc::cryptolink::Hash::getHashAlgorithm ( ) const

Returns the HashAlgorithm of the object.

Returns
hash algorithm

Definition at line 165 of file botan_hash.cc.

References isc::cryptolink::HashImpl::getHashAlgorithm().

+ Here is the call graph for this function:

◆ getOutputLength()

size_t isc::cryptolink::Hash::getOutputLength ( ) const

Returns the output size of the digest.

Returns
output size of the digest

Definition at line 170 of file botan_hash.cc.

References isc::cryptolink::HashImpl::getOutputLength().

+ Here is the call graph for this function:

◆ update()

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

Add data to digest.

Exceptions
LibraryErrorif there was any unexpected exception in the underlying library
Parameters
dataThe data to add
lenThe size of the data

Definition at line 175 of file botan_hash.cc.

References isc::cryptolink::HashImpl::update().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CryptoLink::createHash


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