aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GpgUID.cpp
diff options
context:
space:
mode:
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;
+}