Qt: data decryption using private/public key

走远了吗. 提交于 2019-12-24 08:39:39

问题


I want to decrypt data which has been encrypted using a private key. I can load the public key for decryption as follows:

QFile file(":/sample.crt");
file.open(QIODevice::ReadOnly);
const QByteArray bytes = file.readAll();
file.close();

QSslCertificate ssl(bytes, QSsl::Pem);
//Key: ssl.publicKey();

But how can I use the key do decrypt the data? I know that there are 3rd party libraries like QCA (http://delta.affinix.com/qca/) but is it possible to do this with the built-in Qt functions?

Regards,


回答1:


I came to the conclusion that Qt does not support this. A good workaround is to use EVP OpenSSL functions: https://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption



来源:https://stackoverflow.com/questions/39115958/qt-data-decryption-using-private-public-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!