29 #ifndef GPGFRONTEND_GPGKEY_H
30 #define GPGFRONTEND_GPGKEY_H
32 #include "GpgSubKey.h"
41 class GPGFRONTEND_CORE_EXPORT
GpgKey {
49 [[nodiscard]]
bool IsGood()
const;
56 [[nodiscard]] std::string GetId()
const;
63 [[nodiscard]] std::string GetName()
const;
70 [[nodiscard]] std::string GetEmail()
const;
77 [[nodiscard]] std::string GetComment()
const;
84 [[nodiscard]] std::string GetFingerprint()
const;
91 [[nodiscard]] std::string GetProtocol()
const;
98 [[nodiscard]] std::string GetOwnerTrust()
const;
105 [[nodiscard]] std::string GetPublicKeyAlgo()
const;
112 [[nodiscard]] boost::posix_time::ptime GetLastUpdateTime()
const;
119 [[nodiscard]] boost::posix_time::ptime GetExpireTime()
const;
126 [[nodiscard]] boost::posix_time::ptime GetCreateTime()
const;
133 [[nodiscard]]
unsigned int GetPrimaryKeyLength()
const;
141 [[nodiscard]]
bool IsHasEncryptionCapability()
const;
150 [[nodiscard]]
bool IsHasActualEncryptionCapability()
const;
158 [[nodiscard]]
bool IsHasSigningCapability()
const;
166 [[nodiscard]]
bool IsHasActualSigningCapability()
const;
174 [[nodiscard]]
bool IsHasCertificationCapability()
const;
182 [[nodiscard]]
bool IsHasActualCertificationCapability()
const;
190 [[nodiscard]]
bool IsHasAuthenticationCapability()
const;
198 [[nodiscard]]
bool IsHasActualAuthenticationCapability()
const;
206 [[nodiscard]]
bool IsHasCardKey()
const;
214 [[nodiscard]]
bool IsPrivateKey()
const;
222 [[nodiscard]]
bool IsExpired()
const;
230 [[nodiscard]]
bool IsRevoked()
const;
238 [[nodiscard]]
bool IsDisabled()
const;
246 [[nodiscard]]
bool IsHasMasterKey()
const;
253 [[nodiscard]] std::unique_ptr<std::vector<GpgSubKey>> GetSubKeys()
const;
260 [[nodiscard]] std::unique_ptr<std::vector<GpgUID>> GetUIDs()
const;
273 explicit GpgKey(gpgme_key_t&& key);
318 bool operator==(
const GpgKey& o)
const;
327 bool operator<=(
const GpgKey& o)
const;
334 explicit operator gpgme_key_t()
const;
341 [[nodiscard]]
GpgKey Copy()
const;
349 void operator()(gpgme_key_t _key);
352 using KeyRefHandler =
353 std::unique_ptr<struct _gpgme_key, _key_ref_deleter>;
355 KeyRefHandler key_ref_ =
nullptr;
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