diff options
author | Saturneric <[email protected]> | 2021-06-23 08:14:31 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-06-23 08:14:31 +0000 |
commit | f96179e926ee8733ed3bd8c8b950cb24f57e46d5 (patch) | |
tree | aae77ffa5d4a1636d0778c67c9d573a74bde220f /src/gpg/GpgContext.cpp | |
parent | Fix Problem in Project Configuration. (diff) | |
download | GpgFrontend-f96179e926ee8733ed3bd8c8b950cb24f57e46d5.tar.gz GpgFrontend-f96179e926ee8733ed3bd8c8b950cb24f57e46d5.zip |
UI Improved.
Bugs Fixed.
Diffstat (limited to 'src/gpg/GpgContext.cpp')
-rw-r--r-- | src/gpg/GpgContext.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gpg/GpgContext.cpp b/src/gpg/GpgContext.cpp index 62d7a246..603ad90b 100644 --- a/src/gpg/GpgContext.cpp +++ b/src/gpg/GpgContext.cpp @@ -1215,4 +1215,30 @@ namespace GpgME { return err; } + + bool GpgContext::exportKeys(const QVector<GpgKey> &keys, QByteArray &outBuffer) { + size_t read_bytes; + gpgme_data_t dataOut = nullptr; + outBuffer.resize(0); + + if (keys.count() == 0) { + QMessageBox::critical(nullptr, "Export Keys Error", "No Keys Selected"); + return false; + } + + for (const auto& key : keys) { + err = gpgme_data_new(&dataOut); + checkErr(err); + + err = gpgme_op_export(mCtx,key.id.toUtf8().constData(), 0, dataOut); + checkErr(err); + + read_bytes = gpgme_data_seek(dataOut, 0, SEEK_END); + + err = readToBuffer(dataOut, &outBuffer); + checkErr(err); + gpgme_data_release(dataOut); + } + return true; + } }
\ No newline at end of file |