aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/function/GpgKeyGetter.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-08-29 10:49:58 +0000
committerSaturneric <[email protected]>2021-08-29 10:49:58 +0000
commitdaaa83549d42395161e34a40e18c3615801b1501 (patch)
tree7ae4c67a31e9eea8a7bda4719fbdac3ac2e730a9 /src/gpg/function/GpgKeyGetter.cpp
parentUpdate version settings. (diff)
downloadGpgFrontend-daaa83549d42395161e34a40e18c3615801b1501.tar.gz
GpgFrontend-daaa83549d42395161e34a40e18c3615801b1501.zip
Start to rewrite gpg core.
Diffstat (limited to '')
-rw-r--r--src/gpg/function/GpgKeyGetter.cpp (renamed from include/gpg/GpgKeySignature.h)51
1 files changed, 11 insertions, 40 deletions
diff --git a/include/gpg/GpgKeySignature.h b/src/gpg/function/GpgKeyGetter.cpp
index 0dd2f893..e4572290 100644
--- a/include/gpg/GpgKeySignature.h
+++ b/src/gpg/function/GpgKeyGetter.cpp
@@ -22,46 +22,17 @@
*
*/
-#ifndef GPGFRONTEND_GPGKEYSIGNATURE_H
-#define GPGFRONTEND_GPGKEYSIGNATURE_H
+#include "gpg/function/GpgKeyGetter.h"
-#include "GpgFrontend.h"
-struct GpgKeySignature {
+GpgFrontend::GpgKey &&GpgFrontend::GpgKeyGetter::getKey(const std::string &fpr) {
+ gpgme_key_t _p_key;
+ gpgme_get_key(ctx, fpr.c_str(), &_p_key, 1);
+ return std::move(GpgKey(std::move(_p_key)));
+}
- bool revoked{};
- bool expired{};
- bool invalid{};
- bool exportable{};
-
- gpgme_error_t status{};
-
- QString keyid;
- QString pubkey_algo;
-
- QDateTime create_time;
- QDateTime expire_time;
-
- QString uid;
- QString name;
- QString email;
- QString comment;
-
- gpgme_sigsum_t summary;
-
- GpgKeySignature() = default;
-
- explicit GpgKeySignature(gpgme_key_sig_t key_sig);
-
- GpgKeySignature(GpgKeySignature &&) noexcept = default;
-
- GpgKeySignature(const GpgKeySignature &) = default;
-
- GpgKeySignature &operator=(GpgKeySignature &&) noexcept = default;
-
- GpgKeySignature &operator=(const GpgKeySignature &) = default;
-
-};
-
-
-#endif //GPGFRONTEND_GPGKEYSIGNATURE_H
+GpgFrontend::GpgKey &&GpgFrontend::GpgKeyGetter::getPubkey(const std::string &fpr) {
+ gpgme_key_t _p_key;
+ gpgme_get_key(ctx, fpr.c_str(), &_p_key, 0);
+ return std::move(GpgKey(std::move(_p_key)));
+}