GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgUID.h
1 
29 #pragma once
30 
31 #include "GpgKeySignature.h"
32 #include "GpgTOFUInfo.h"
33 
34 namespace GpgFrontend {
39 class GPGFRONTEND_CORE_EXPORT GpgUID {
40  public:
46  [[nodiscard]] auto GetName() const -> QString;
47 
53  [[nodiscard]] auto GetEmail() const -> QString;
54 
60  [[nodiscard]] auto GetComment() const -> QString;
61 
67  [[nodiscard]] auto GetUID() const -> QString;
68 
75  [[nodiscard]] auto GetRevoked() const -> bool;
76 
83  [[nodiscard]] auto GetInvalid() const -> bool;
84 
90  [[nodiscard]] auto GetTofuInfos() const
91  -> std::unique_ptr<std::vector<GpgTOFUInfo>>;
92 
98  [[nodiscard]] auto GetSignatures() const
99  -> std::unique_ptr<std::vector<GpgKeySignature>>;
100 
106 
112  explicit GpgUID(gpgme_user_id_t uid);
113 
119  GpgUID(GpgUID &&o) noexcept;
120 
125  GpgUID(const GpgUID &) = delete;
126 
133  auto operator=(GpgUID &&o) noexcept -> GpgUID &;
134 
140  auto operator=(const GpgUID &) -> 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
Definition: GpgUID.h:39
GpgUID()
Construct a new Gpg U I D object.
GpgUID(const GpgUID &)=delete
Construct a new Gpg U I D object.
auto operator=(const GpgUID &) -> GpgUID &=delete
auto operator=(GpgUID &&o) noexcept -> GpgUID &
Definition: app.cpp:39