GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
|
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);
286 GpgKey(
const gpgme_key_t& key) =
delete;
309 GpgKey& operator=(
const gpgme_key_t& key) =
delete;
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;
360 #endif // GPGFRONTEND_GPGKEY_H
bool IsHasCardKey() const
Definition: GpgKey.cpp:131
GpgKey()=default
Construct a new Gpg Key object.
GpgKey & operator=(GpgKey &&k) noexcept
Definition: GpgKey.cpp:35
std::string GetId() const
Definition: GpgKey.cpp:52
bool IsHasSigningCapability() const
Definition: GpgKey.cpp:119
Definition: CoreCommonUtil.cpp:29
bool IsHasActualCertificationCapability() const
Definition: GpgKey.cpp:205
GpgKey Copy() const
Definition: GpgKey.cpp:227
std::string GetComment() const
Definition: GpgKey.cpp:64
bool operator<=(const GpgKey &o) const
Definition: GpgKey.cpp:44
std::string GetEmail() const
Definition: GpgKey.cpp:60
std::unique_ptr< std::vector< GpgSubKey > > GetSubKeys() const
Definition: GpgKey.cpp:151
std::string GetOwnerTrust() const
Definition: GpgKey.cpp:76
boost::posix_time::ptime GetCreateTime() const
Create a time object.
Definition: GpgKey.cpp:107
bool IsGood() const
Definition: GpgKey.cpp:50
bool IsHasActualEncryptionCapability() const
Definition: GpgKey.cpp:214
bool operator==(const GpgKey &o) const
Definition: GpgKey.cpp:40
bool IsHasActualSigningCapability() const
Definition: GpgKey.cpp:172
bool IsHasActualAuthenticationCapability() const
Definition: GpgKey.cpp:186
bool IsPrivateKey() const
Definition: GpgKey.cpp:138
unsigned int GetPrimaryKeyLength() const
s
Definition: GpgKey.cpp:111
std::string GetPublicKeyAlgo() const
Definition: GpgKey.cpp:94
boost::posix_time::ptime GetExpireTime() const
Definition: GpgKey.cpp:103
bool IsHasAuthenticationCapability() const
Definition: GpgKey.cpp:127
bool IsExpired() const
Definition: GpgKey.cpp:140
Definition: GpgSubKey.h:43
std::string GetProtocol() const
Definition: GpgKey.cpp:72
bool IsRevoked() const
Definition: GpgKey.cpp:142
std::unique_ptr< std::vector< GpgUID > > GetUIDs() const
Definition: GpgKey.cpp:161
bool IsHasEncryptionCapability() const
Definition: GpgKey.cpp:115
bool IsDisabled() const
Definition: GpgKey.cpp:144
bool IsHasCertificationCapability() const
Definition: GpgKey.cpp:123
bool IsHasMasterKey() const
Definition: GpgKey.cpp:146
boost::posix_time::ptime GetLastUpdateTime() const
Definition: GpgKey.cpp:98
std::string GetFingerprint() const
Definition: GpgKey.cpp:68
std::string GetName() const
Definition: GpgKey.cpp:56