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]]
int GetOwnerTrustLevel()
const;
114 [[nodiscard]] std::string GetPublicKeyAlgo()
const;
121 [[nodiscard]] boost::posix_time::ptime GetLastUpdateTime()
const;
128 [[nodiscard]] boost::posix_time::ptime GetExpireTime()
const;
135 [[nodiscard]] boost::posix_time::ptime GetCreateTime()
const;
142 [[nodiscard]]
unsigned int GetPrimaryKeyLength()
const;
150 [[nodiscard]]
bool IsHasEncryptionCapability()
const;
159 [[nodiscard]]
bool IsHasActualEncryptionCapability()
const;
167 [[nodiscard]]
bool IsHasSigningCapability()
const;
175 [[nodiscard]]
bool IsHasActualSigningCapability()
const;
183 [[nodiscard]]
bool IsHasCertificationCapability()
const;
191 [[nodiscard]]
bool IsHasActualCertificationCapability()
const;
199 [[nodiscard]]
bool IsHasAuthenticationCapability()
const;
207 [[nodiscard]]
bool IsHasActualAuthenticationCapability()
const;
215 [[nodiscard]]
bool IsHasCardKey()
const;
223 [[nodiscard]]
bool IsPrivateKey()
const;
231 [[nodiscard]]
bool IsExpired()
const;
239 [[nodiscard]]
bool IsRevoked()
const;
247 [[nodiscard]]
bool IsDisabled()
const;
255 [[nodiscard]]
bool IsHasMasterKey()
const;
262 [[nodiscard]] std::unique_ptr<std::vector<GpgSubKey>> GetSubKeys()
const;
269 [[nodiscard]] std::unique_ptr<std::vector<GpgUID>> GetUIDs()
const;
282 explicit GpgKey(gpgme_key_t&& key);
327 bool operator==(
const GpgKey& o)
const;
336 bool operator<=(
const GpgKey& o)
const;
343 explicit operator gpgme_key_t()
const;
350 [[nodiscard]]
GpgKey Copy()
const;
358 void operator()(gpgme_key_t _key);
361 using KeyRefHandler =
362 std::unique_ptr<struct _gpgme_key, _key_ref_deleter>;
364 KeyRefHandler key_ref_ =
nullptr;
366 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:31