29 #ifndef GPGFRONTEND_GPGKEY_H
30 #define GPGFRONTEND_GPGKEY_H
34 #include "GpgSubKey.h"
43 class GPGFRONTEND_CORE_EXPORT
GpgKey {
51 [[nodiscard]]
bool IsGood()
const;
58 [[nodiscard]] std::string GetId()
const;
65 [[nodiscard]] std::string GetName()
const;
72 [[nodiscard]] std::string GetEmail()
const;
79 [[nodiscard]] std::string GetComment()
const;
86 [[nodiscard]] std::string GetFingerprint()
const;
93 [[nodiscard]] std::string GetProtocol()
const;
100 [[nodiscard]] std::string GetOwnerTrust()
const;
107 [[nodiscard]] std::string GetPublicKeyAlgo()
const;
114 [[nodiscard]] boost::posix_time::ptime GetLastUpdateTime()
const;
121 [[nodiscard]] boost::posix_time::ptime GetExpireTime()
const;
128 [[nodiscard]] boost::posix_time::ptime GetCreateTime()
const;
135 [[nodiscard]]
unsigned int GetPrimaryKeyLength()
const;
143 [[nodiscard]]
bool IsHasEncryptionCapability()
const;
152 [[nodiscard]]
bool IsHasActualEncryptionCapability()
const;
160 [[nodiscard]]
bool IsHasSigningCapability()
const;
168 [[nodiscard]]
bool IsHasActualSigningCapability()
const;
176 [[nodiscard]]
bool IsHasCertificationCapability()
const;
184 [[nodiscard]]
bool IsHasActualCertificationCapability()
const;
192 [[nodiscard]]
bool IsHasAuthenticationCapability()
const;
200 [[nodiscard]]
bool IsHasActualAuthenticationCapability()
const;
208 [[nodiscard]]
bool IsHasCardKey()
const;
216 [[nodiscard]]
bool IsPrivateKey()
const;
224 [[nodiscard]]
bool IsExpired()
const;
232 [[nodiscard]]
bool IsRevoked()
const;
240 [[nodiscard]]
bool IsDisabled()
const;
248 [[nodiscard]]
bool IsHasMasterKey()
const;
255 [[nodiscard]] std::unique_ptr<std::vector<GpgSubKey>> GetSubKeys()
const;
262 [[nodiscard]] std::unique_ptr<std::vector<GpgUID>> GetUIDs()
const;
275 explicit GpgKey(gpgme_key_t&& key);
320 bool operator==(
const GpgKey& o)
const;
329 bool operator<=(
const GpgKey& o)
const;
336 explicit operator gpgme_key_t()
const;
343 [[nodiscard]]
GpgKey Copy()
const;
351 void operator()(gpgme_key_t _key);
354 using KeyRefHandler =
355 std::unique_ptr<struct _gpgme_key, _key_ref_deleter>;
357 KeyRefHandler key_ref_ =
nullptr;
359 mutable std::mutex gpgme_key_opera_mutex;
GpgKey(const gpgme_key_t &key)=delete
Construct a new Gpg Key object.
~GpgKey()=default
Destroy the Gpg Key objects.
GpgKey()=default
Construct a new Gpg Key object.
GpgKey & operator=(const gpgme_key_t &key)=delete
Definition: CoreCommonUtil.cpp:29