#include <QtCrypto>
#include <QCoreApplication>
#include <iostream>
#ifdef QT_STATICPLUGIN
#include "import_plugins.h"
#endif
{
std::cout << " Organization: " << std::endl;
QString organization;
foreach( organization, orgInfoList ) {
std::cout << " " << qPrintable(organization) << std::endl;
}
std::cout << " Country: " << std::endl;
std::cout << " " << qPrintable(country) << std::endl;
}
}
{
std::cout << "Subject: " << std::endl;
dumpCertificateInfo( subject );
}
{
std::cout << "Issuer: " << std::endl;
dumpCertificateInfo( issuer );
}
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
std::cout << "Sorry, no PKI certificate support" << std::endl;
return 1;
}
if (argc >= 2) {
std::cout << "Import succeeded" << std::endl;
}
} else {
std::cout << "System certificates not available" << std::endl;
return 2;
}
}
std::cout << "Number of certificates: " << certlist.count() << std::endl;
foreach (cert, certlist) {
std::cout << "Serial Number:";
std::cout << "Is certificate authority" << std::endl;
} else {
std::cout << "Is not a certificate authority" << std::endl;
}
std::cout << "Self signed" << std::endl;
} else {
std::cout << "Is not self-signed!!!" << std::endl;
}
std::cout <<
"Valid from " << qPrintable(cert.
notValidBefore().toString());
std::cout <<
", until " << qPrintable(cert.
notValidAfter().toString());
std::cout << std::endl;
std::cout << "PEM:" << std::endl;
std::cout << qPrintable(cert.
toPEM());
std::cout << std::endl << std::endl;
}
return 0;
}