aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GpgUID.cpp
diff options
context:
space:
mode:
authorSaturn&Eric <[email protected]>2022-05-08 13:14:24 +0000
committerGitHub <[email protected]>2022-05-08 13:14:24 +0000
commitf722eec9a898c97e233619a50f6f1a94fef6f94c (patch)
tree26757206ff3e139a10968bd8ae6147ca1a1182a7 /src/core/model/GpgUID.cpp
parentMerge pull request #50 from saturneric/develop-2.0.5 (diff)
parentdoc: update translate document. (diff)
downloadGpgFrontend-f722eec9a898c97e233619a50f6f1a94fef6f94c.tar.gz
GpgFrontend-f722eec9a898c97e233619a50f6f1a94fef6f94c.zip
Merge pull request #54 from saturneric/develop-2.0.6v2.0.6
Develop 2.0.6
Diffstat (limited to 'src/core/model/GpgUID.cpp')
-rw-r--r--src/core/model/GpgUID.cpp42
1 files changed, 41 insertions, 1 deletions
diff --git a/src/core/model/GpgUID.cpp b/src/core/model/GpgUID.cpp
index 6d98c882..d87192c3 100644
--- a/src/core/model/GpgUID.cpp
+++ b/src/core/model/GpgUID.cpp
@@ -28,5 +28,45 @@
#include "core/model/GpgUID.h"
+GpgFrontend::GpgUID::GpgUID() = default;
+
GpgFrontend::GpgUID::GpgUID(gpgme_user_id_t uid)
- : uid_ref_(uid, [&](gpgme_user_id_t uid) {}) {} \ No newline at end of file
+ : uid_ref_(uid, [&](gpgme_user_id_t uid) {}) {}
+
+GpgFrontend::GpgUID::GpgUID(GpgUID &&o) noexcept { swap(uid_ref_, o.uid_ref_); }
+
+std::string GpgFrontend::GpgUID::GetName() const { return uid_ref_->name; }
+
+std::string GpgFrontend::GpgUID::GetEmail() const { return uid_ref_->email; }
+
+std::string GpgFrontend::GpgUID::GetComment() const {
+ return uid_ref_->comment;
+}
+
+std::string GpgFrontend::GpgUID::GetUID() const { return uid_ref_->uid; }
+
+bool GpgFrontend::GpgUID::GetRevoked() const { return uid_ref_->revoked; }
+
+bool GpgFrontend::GpgUID::GetInvalid() const { return uid_ref_->invalid; }
+
+std::unique_ptr<std::vector<GpgFrontend::GpgTOFUInfo>>
+GpgFrontend::GpgUID::GetTofuInfos() const {
+ auto infos = std::make_unique<std::vector<GpgTOFUInfo>>();
+ auto info_next = uid_ref_->tofu;
+ while (info_next != nullptr) {
+ infos->push_back(GpgTOFUInfo(info_next));
+ info_next = info_next->next;
+ }
+ return infos;
+}
+
+std::unique_ptr<std::vector<GpgFrontend::GpgKeySignature>>
+GpgFrontend::GpgUID::GetSignatures() const {
+ auto sigs = std::make_unique<std::vector<GpgKeySignature>>();
+ auto sig_next = uid_ref_->signatures;
+ while (sig_next != nullptr) {
+ sigs->push_back(GpgKeySignature(sig_next));
+ sig_next = sig_next->next;
+ }
+ return sigs;
+}