Search code examples
c++qtsignedgnupg

Qt check file signature validity


I have a data file, a signature file (created by the GnuPG) and a public key.

I need to check the validity of the signed file. What's the best way to do this with Qt? I've found the Qt Cryptographic Architecture, but can't find any examples for my task. Can QCA do this?


Solution

  • It's always best not to write crypto yourself. can you write a wrapper around calls to gnupg and just execute gpg --verify pub.key file?

    Having said that, it looks qca has done some of this work, see qca_securemessage.h, you presumeably want to call void startVerify(const QByteArray &detachedSig = QByteArray());