The code below shows how to use the QCA::MessageAuthenticationCode class
#include <QtCrypto>
#include <QCoreApplication>
#include <QDebug>
#include<stdio.h>
#ifdef QT_STATICPLUGIN
#include "import_plugins.h"
#endif
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
qDebug() << "This example shows hashed MAC";
QByteArray arg = (argc >= 2) ? argv[1] : "hello";
printf("HMAC(SHA1) not supported!\n");
} else {
printf(
"HMAC(SHA1) of \"%s\" with \"%s\" = [%s]\n", arg.data(), key.
data(), result.toLatin1().data());
}
return 0;
}