29#ifndef GPGFRONTEND_GPGKEY_H
30#define GPGFRONTEND_GPGKEY_H
32#include <boost/date_time.hpp>
33#include <boost/date_time/posix_time/conversion.hpp>
44class GPGFRONTEND_CORE_EXPORT
GpgKey {
52 [[nodiscard]]
bool IsGood()
const;
59 [[nodiscard]] std::string GetId()
const;
66 [[nodiscard]] std::string GetName()
const;
73 [[nodiscard]] std::string GetEmail()
const;
80 [[nodiscard]] std::string GetComment()
const;
87 [[nodiscard]] std::string GetFingerprint()
const;
94 [[nodiscard]] std::string GetProtocol()
const;
101 [[nodiscard]] std::string GetOwnerTrust()
const;
108 [[nodiscard]] std::string GetPublicKeyAlgo()
const;
115 [[nodiscard]] boost::posix_time::ptime GetLastUpdateTime()
const;
122 [[nodiscard]] boost::posix_time::ptime GetExpireTime()
const;
129 [[nodiscard]] boost::posix_time::ptime GetCreateTime()
const;
136 [[nodiscard]]
unsigned int GetPrimaryKeyLength()
const;
144 [[nodiscard]]
bool IsHasEncryptionCapability()
const;
153 [[nodiscard]]
bool IsHasActualEncryptionCapability()
const;
161 [[nodiscard]]
bool IsHasSigningCapability()
const;
169 [[nodiscard]]
bool IsHasActualSigningCapability()
const;
177 [[nodiscard]]
bool IsHasCertificationCapability()
const;
185 [[nodiscard]]
bool IsHasActualCertificationCapability()
const;
193 [[nodiscard]]
bool IsHasAuthenticationCapability()
const;
201 [[nodiscard]]
bool IsHasActualAuthenticationCapability()
const;
209 [[nodiscard]]
bool IsHasCardKey()
const;
217 [[nodiscard]]
bool IsPrivateKey()
const;
225 [[nodiscard]]
bool IsExpired()
const;
233 [[nodiscard]]
bool IsRevoked()
const;
241 [[nodiscard]]
bool IsDisabled()
const;
249 [[nodiscard]]
bool IsHasMasterKey()
const;
256 [[nodiscard]] std::unique_ptr<std::vector<GpgSubKey>> GetSubKeys()
const;
263 [[nodiscard]] std::unique_ptr<std::vector<GpgUID>> GetUIDs()
const;
276 explicit GpgKey(gpgme_key_t&& key);
321 bool operator==(
const GpgKey& o)
const;
330 bool operator<=(
const GpgKey& o)
const;
337 explicit operator gpgme_key_t()
const;
344 [[nodiscard]]
GpgKey Copy()
const;
352 void operator()(gpgme_key_t _key);
355 using KeyRefHandler =
356 std::unique_ptr<struct _gpgme_key, _key_ref_deleter>;
358 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