rendered paste body#include <QtCrypto>
#include <stdio.h>
#include <QCoreApplication>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QCA::Initializer init;
QByteArray arg = "hello";
QCA::SecureArray key("secret");
QStringList f = QCA::supportedFeatures();
for (QStringList::iterator i = f.begin(); i != f.end(); i++)
printf("feature: %s\n", (*i).toLocal8Bit().constData());
if (!QCA::isSupported("hmac(sha1)")) {
printf("HMAC(SHA1) not supported!\n");
} else {
QCA::MessageAuthenticationCode hmacObject("hmac(sha1)", QCA::SecureArray());
QCA::SymmetricKey keyObject(key);
hmacObject.setup(key);
// ...
}
return 0;
}