GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgKeySignature.h
1 
29 #pragma once
30 
31 #include "core/typedef/GpgTypedef.h"
32 
37 namespace GpgFrontend {
38 
43 class GPGFRONTEND_CORE_EXPORT GpgKeySignature {
44  public:
51  [[nodiscard]] auto IsRevoked() const -> bool;
52 
59  [[nodiscard]] auto IsExpired() const -> bool;
60 
67  [[nodiscard]] auto IsInvalid() const -> bool;
68 
75  [[nodiscard]] auto IsExportable() const -> bool;
76 
82  [[nodiscard]] auto GetStatus() const -> GpgError;
83 
89  [[nodiscard]] auto GetKeyID() const -> QString;
90 
96  [[nodiscard]] auto GetPubkeyAlgo() const -> QString;
97 
103  [[nodiscard]] auto GetCreateTime() const -> QDateTime;
104 
110  [[nodiscard]] auto GetExpireTime() const -> QDateTime;
111 
117  [[nodiscard]] auto GetUID() const -> QString;
118 
124  [[nodiscard]] auto GetName() const -> QString;
125 
131  [[nodiscard]] auto GetEmail() const -> QString;
132 
138  [[nodiscard]] auto GetComment() const -> QString;
139 
145 
151 
157  explicit GpgKeySignature(gpgme_key_sig_t sig);
158 
164 
169  GpgKeySignature(const GpgKeySignature &) = delete;
170 
176  auto operator=(GpgKeySignature &&) noexcept -> GpgKeySignature &;
177 
183  auto operator=(const GpgKeySignature &) -> GpgKeySignature & = delete;
184 
185  private:
186  using KeySignatrueRefHandler =
187  std::unique_ptr<struct _gpgme_key_sig,
188  std::function<void(gpgme_key_sig_t)>>;
189 
190  KeySignatrueRefHandler signature_ref_ = nullptr;
191 };
192 
193 } // namespace GpgFrontend
Definition: GpgKeySignature.h:43
GpgKeySignature()
Construct a new Gpg Key Signature object.
GpgKeySignature(GpgKeySignature &&) noexcept
Construct a new Gpg Key Signature object.
~GpgKeySignature()
Destroy the Gpg Key Signature object.
Definition: app.cpp:39
gpgme_error_t GpgError
gpgme error
Definition: GpgTypedef.h:42