UCommon
ucommon::HMAC Class Reference

A cryptographic message authentication code class. More...

#include <secure.h>

Public Member Functions

 HMAC (const char *digest, const secure::keybytes &key)
 
secure::keybytes key (void)
 
 operator bool () const
 
 operator secure::string ()
 
bool operator! () const
 
secure::string operator* ()
 
bool operator*= (const char *text)
 
bool operator+= (const char *text)
 
HMACoperator<< (const char *str)
 
HMACoperator<< (const PrintProtocol &p)
 
HMACoperator<< (int16_t value)
 
HMACoperator<< (int32_t value)
 
bool put (const void *memory, size_t size)
 
bool puts (const char *str)
 
void set (const char *digest, const secure::keybytes &key)
 
unsigned size () const
 
secure::string str (void)
 

Static Public Member Functions

static bool has (const char *name)
 Test to see if a specific digest type is supported.
 
static secure::keybytes sha256 (secure::keybytes key, const uint8_t *mem, size_t size)
 
static secure::keybytes sha384 (secure::keybytes key, const uint8_t *mem, size_t soze)
 

Protected Member Functions

const uint8_t * get (void)
 
void release (void)
 

Detailed Description

A cryptographic message authentication code class.

This class can support md5 digests, sha1, sha256, etc, depending on what the underlying library supports.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 656 of file secure.h.

Member Function Documentation

◆ has()

static bool ucommon::HMAC::has ( const char * name)
static

Test to see if a specific digest type is supported.

Parameters
nameof digest we want to check.
Returns
true if supported, false if not.

◆ operator bool()

ucommon::HMAC::operator bool ( ) const
inline

Definition at line 744 of file secure.h.

◆ operator secure::string()

ucommon::HMAC::operator secure::string ( )
inline

Definition at line 722 of file secure.h.

◆ operator!()

bool ucommon::HMAC::operator! ( ) const
inline

Definition at line 740 of file secure.h.

◆ operator*()

secure::string ucommon::HMAC::operator* ( )
inline

Definition at line 736 of file secure.h.

◆ operator*=()

bool ucommon::HMAC::operator*= ( const char * text)
inline

Definition at line 726 of file secure.h.

◆ operator+=()

bool ucommon::HMAC::operator+= ( const char * text)
inline

Definition at line 732 of file secure.h.

◆ operator<<() [1/4]

HMAC & ucommon::HMAC::operator<< ( const char * str)
inline

Definition at line 688 of file secure.h.

◆ operator<<() [2/4]

HMAC & ucommon::HMAC::operator<< ( const PrintProtocol & p)
inline

Definition at line 705 of file secure.h.

◆ operator<<() [3/4]

HMAC & ucommon::HMAC::operator<< ( int16_t value)
inline

Definition at line 693 of file secure.h.

◆ operator<<() [4/4]

HMAC & ucommon::HMAC::operator<< ( int32_t value)
inline

Definition at line 699 of file secure.h.

◆ puts()

bool ucommon::HMAC::puts ( const char * str)
inline

Definition at line 684 of file secure.h.

◆ size()

unsigned ucommon::HMAC::size ( ) const
inline

Definition at line 714 of file secure.h.

Field Documentation

◆ hmacid

int ucommon::HMAC::hmacid

Definition at line 663 of file secure.h.

◆ hmactype

const void* ucommon::HMAC::hmactype

Definition at line 662 of file secure.h.


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