MagicSmoke  $VERSION$
SMHmac Class Reference

Calculate a cryptographic HMAC (used by authentication algorithm) More...

#include <hmac.h>

Public Member Functions

 SMHmac (QCryptographicHash::Algorithm algo, const QByteArray &key)
 constructs an object that calculates HMACs More...
 
void addData (const char *data, int length)
 adds length bytes of data to the hash-stream More...
 
void addData (const QByteArray &data)
 adds data to the hash-stream More...
 
void reset ()
 reset the hash to the state immediately after construction More...
 
QByteArray result ()
 finalize the hash and return the result More...
 

Static Public Member Functions

static int blockWidth (QCryptographicHash::Algorithm)
 returns the length of the blocks used internally in the given algorithm in bytes; this should have been implemented by QCryptographicHash! returns -1 if in doubt More...
 
static QByteArray hmac (const QByteArray &data, const QByteArray &key, QCryptographicHash::Algorithm method)
 complete HMAC calculation in a can More...
 
static int resultWidth (QCryptographicHash::Algorithm)
 returns the length of the results of given algorithm in bytes; this should have been implemented by QCryptographicHash! performs a test calculation if the algo is unknown More...
 

Detailed Description

Calculate a cryptographic HMAC (used by authentication algorithm)

Constructor & Destructor Documentation

SMHmac::SMHmac ( QCryptographicHash::Algorithm  algo,
const QByteArray &  key 
)

constructs an object that calculates HMACs

References blockWidth().

Member Function Documentation

void SMHmac::addData ( const char *  data,
int  length 
)

adds length bytes of data to the hash-stream

Referenced by hmac().

void SMHmac::addData ( const QByteArray &  data)

adds data to the hash-stream

int SMHmac::blockWidth ( QCryptographicHash::Algorithm  a)
static

returns the length of the blocks used internally in the given algorithm in bytes; this should have been implemented by QCryptographicHash! returns -1 if in doubt

Referenced by SMHmac().

QByteArray SMHmac::hmac ( const QByteArray &  data,
const QByteArray &  key,
QCryptographicHash::Algorithm  method 
)
static

complete HMAC calculation in a can

References addData(), and result().

Referenced by EFilter::getRandom().

void SMHmac::reset ( )

reset the hash to the state immediately after construction

QByteArray SMHmac::result ( )

finalize the hash and return the result

Referenced by hmac().

int SMHmac::resultWidth ( QCryptographicHash::Algorithm  a)
static

returns the length of the results of given algorithm in bytes; this should have been implemented by QCryptographicHash! performs a test calculation if the algo is unknown


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