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 
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
Definition: GpgUID.h:40
GpgUID()
Construct a new Gpg U I D object.
GpgUID(const GpgUID &)=delete
Construct a new Gpg U I D object.
GpgUID & operator=(const GpgUID &)=delete
GpgUID & operator=(GpgUID &&o) noexcept
Definition: CoreCommonUtil.cpp:31