#include <qxthmac.h>
|
| typedef QCryptographicHash::Algorithm | Algorithm |
|
| | QxtHmac (QCryptographicHash::Algorithm algorithm) |
| void | setKey (QByteArray key) |
| void | reset () |
| void | addData (const char *data, int length) |
| void | addData (const QByteArray &data) |
| QByteArray | innerHash () const |
| QByteArray | result () |
| bool | verify (const QByteArray &otherInner) |
|
| static QByteArray | hash (const QByteArray &key, const QByteArray &data, Algorithm algorithm) |
| static bool | verify (const QByteArray &key, const QByteArray &hmac, const QByteArray &inner, Algorithm algorithm) |
◆ Algorithm
◆ QxtHmac()
| QxtHmac::QxtHmac |
( |
QCryptographicHash::Algorithm | algorithm | ) |
|
Constructs a QxtHmac object using the specified algorithm.
◆ addData() [1/2]
| void QxtHmac::addData |
( |
const char * | data, |
|
|
int | length ) |
Adds the provided data to the message to be authenticated.
◆ addData() [2/2]
| void QxtHmac::addData |
( |
const QByteArray & | data | ) |
|
Adds the provided data to the message to be authenticated.
◆ hash()
| QByteArray QxtHmac::hash |
( |
const QByteArray & | key, |
|
|
const QByteArray & | data, |
|
|
Algorithm | algorithm ) |
|
static |
Returns the HMAC of the provided data using the specified key and hashing algorithm.
◆ innerHash()
| QByteArray QxtHmac::innerHash |
( |
| ) |
const |
Returns the inner hash of the HMAC function.
This hash can be stored in lieu of the shared secret on the authenticating side and used for verifying an HMAC code. When used in this manner, HMAC can be used to provide a form of secure password authentication. See the documentation above for details.
◆ reset()
Resets the object.
Any data that had been processed using addData() will be discarded. The key, if set, will be preserved.
◆ result()
| QByteArray QxtHmac::result |
( |
| ) |
|
Returns the authentication code for the message.
◆ setKey()
| void QxtHmac::setKey |
( |
QByteArray | key | ) |
|
Sets the shared secret key for the message authentication code.
Any data that had been processed using addData() will be discarded.
◆ verify() [1/2]
| bool QxtHmac::verify |
( |
const QByteArray & | key, |
|
|
const QByteArray & | hmac, |
|
|
const QByteArray & | inner, |
|
|
Algorithm | algorithm ) |
|
static |
Verifies a HMAC against a known key and inner hash using the specified hashing algorithm.
◆ verify() [2/2]
| bool QxtHmac::verify |
( |
const QByteArray & | otherInner | ) |
|
Verifies the authentication code against a known inner hash.
- See also
- innerHash()
The documentation for this class was generated from the following files: