GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgSubKey.h
1 
29 #pragma once
30 
31 namespace GpgFrontend {
32 
37 class GPGFRONTEND_CORE_EXPORT GpgSubKey {
38  public:
44  [[nodiscard]] auto GetID() const -> QString;
45 
51  [[nodiscard]] auto GetFingerprint() const -> QString;
52 
58  [[nodiscard]] auto GetPubkeyAlgo() const -> QString;
59 
65  [[nodiscard]] auto GetKeyAlgo() const -> QString;
66 
72  [[nodiscard]] auto GetKeyLength() const -> unsigned int;
73 
80  [[nodiscard]] auto IsHasEncryptionCapability() const -> bool;
81 
88  [[nodiscard]] auto IsHasSigningCapability() const -> bool;
89 
96  [[nodiscard]] auto IsHasCertificationCapability() const -> bool;
97 
104  [[nodiscard]] auto IsHasAuthenticationCapability() const -> bool;
105 
112  [[nodiscard]] auto IsPrivateKey() const -> bool;
113 
120  [[nodiscard]] auto IsExpired() const -> bool;
121 
128  [[nodiscard]] auto IsRevoked() const -> bool;
129 
136  [[nodiscard]] auto IsDisabled() const -> bool;
137 
144  [[nodiscard]] auto IsSecretKey() const -> bool;
145 
152  [[nodiscard]] auto IsCardKey() const -> bool;
153 
159  [[nodiscard]] auto GetCreateTime() const -> QDateTime;
160 
166  [[nodiscard]] QDateTime GetExpireTime() const;
167 
173 
179  explicit GpgSubKey(gpgme_subkey_t subkey);
180 
186  GpgSubKey(GpgSubKey&& o) noexcept;
187 
192  GpgSubKey(const GpgSubKey&) = delete;
193 
200  auto operator=(GpgSubKey&& o) noexcept -> GpgSubKey&;
201 
207  auto operator=(const GpgSubKey&) -> GpgSubKey& = delete;
208 
216  auto operator==(const GpgSubKey& o) const -> bool;
217 
218  private:
219  using SubkeyRefHandler =
220  std::unique_ptr<struct _gpgme_subkey,
221  std::function<void(gpgme_subkey_t)>>;
222 
223  SubkeyRefHandler subkey_ref_ = nullptr;
224 };
225 
226 } // namespace GpgFrontend
Definition: GpgSubKey.h:37
GpgSubKey()
Construct a new Gpg Sub Key object.
GpgSubKey(const GpgSubKey &)=delete
Construct a new Gpg Sub Key object.
auto operator=(const GpgSubKey &) -> GpgSubKey &=delete
Definition: app.cpp:39