GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

GpgUID.h
1
29 #ifndef GPGFRONTEND_GPGUID_H
30 #define GPGFRONTEND_GPGUID_H
31
32 #include "GpgKeySignature.h"
33 #include "GpgTOFUInfo.h"
34
35 namespace GpgFrontend {
40 class GPGFRONTEND_CORE_EXPORT GpgUID {
41 public:
47 [[nodiscard]] std::string GetName() const;
48
54 [[nodiscard]] std::string GetEmail() const;
55
61 [[nodiscard]] std::string GetComment() const;
62
68 [[nodiscard]] std::string GetUID() const;
69
76 [[nodiscard]] bool GetRevoked() const;
77
84 [[nodiscard]] bool GetInvalid() const;
85
91 [[nodiscard]] std::unique_ptr<std::vector<GpgTOFUInfo>> GetTofuInfos() const;
92
98 [[nodiscard]] std::unique_ptr<std::vector<GpgKeySignature>> GetSignatures()
99 const;
100
105 GpgUID();
106
112 explicit GpgUID(gpgme_user_id_t uid);
113
119 GpgUID(GpgUID &&o) noexcept;
120
125 GpgUID(const GpgUID &) = delete;
126
133 GpgUID &operator=(GpgUID &&o) noexcept;
134
140 GpgUID &operator=(const GpgUID &) = delete;
141
142 private:
143 using UidRefHandler =
144 std::unique_ptr<struct _gpgme_user_id,
145 std::function<void(gpgme_user_id_t)>>;
146
147 UidRefHandler uid_ref_ = nullptr;
148 };
149
150 } // namespace GpgFrontend
151
152 #endif // GPGFRONTEND_GPGUID_H
GpgFrontend::GpgUID::GetRevoked
bool GetRevoked() const
Definition: GpgUID.cpp:48
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::GpgUID::GetInvalid
bool GetInvalid() const
Definition: GpgUID.cpp:50
GpgFrontend::GpgKeySignature
Definition: GpgKeySignature.h:47
GpgFrontend::GpgUID::GetComment
std::string GetComment() const
Definition: GpgUID.cpp:42
GpgFrontend::GpgUID::GpgUID
GpgUID()
Construct a new Gpg U I D object.
GpgFrontend::GpgTOFUInfo
Definition: GpgTOFUInfo.h:39
GpgFrontend::GpgUID::GetName
std::string GetName() const
Definition: GpgUID.cpp:38
GpgFrontend::GpgUID::GetTofuInfos
std::unique_ptr< std::vector< GpgTOFUInfo > > GetTofuInfos() const
Definition: GpgUID.cpp:53
GpgFrontend::GpgUID::GetUID
std::string GetUID() const
Definition: GpgUID.cpp:46
GpgFrontend::GpgUID
Definition: GpgUID.h:40
GpgFrontend::GpgUID::GetEmail
std::string GetEmail() const
Definition: GpgUID.cpp:40
GpgFrontend::GpgUID::GetSignatures
std::unique_ptr< std::vector< GpgKeySignature > > GetSignatures() const
Definition: GpgUID.cpp:64