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:133
GpgKey()=default
Construct a new Gpg Key object.
GpgKey & operator=(GpgKey &&k) noexcept
Definition: GpgKey.cpp:35
std::string GetId() const
Definition: GpgKey.cpp:54
bool IsHasSigningCapability() const
Definition: GpgKey.cpp:121
Definition: CoreCommonUtil.cpp:29
bool IsHasActualCertificationCapability() const
Definition: GpgKey.cpp:207
GpgKey Copy() const
Definition: GpgKey.cpp:230
std::string GetComment() const
Definition: GpgKey.cpp:66
bool operator<=(const GpgKey &o) const
Definition: GpgKey.cpp:44
std::string GetEmail() const
Definition: GpgKey.cpp:62
std::unique_ptr< std::vector< GpgSubKey > > GetSubKeys() const
Definition: GpgKey.cpp:153
std::string GetOwnerTrust() const
Definition: GpgKey.cpp:78
boost::posix_time::ptime GetCreateTime() const
Create a time object.
Definition: GpgKey.cpp:109
bool IsGood() const
Definition: GpgKey.cpp:52
bool IsHasActualEncryptionCapability() const
Definition: GpgKey.cpp:216
bool operator==(const GpgKey &o) const
Definition: GpgKey.cpp:40
bool IsHasActualSigningCapability() const
Definition: GpgKey.cpp:174
bool IsHasActualAuthenticationCapability() const
Definition: GpgKey.cpp:188
bool IsPrivateKey() const
Definition: GpgKey.cpp:140
unsigned int GetPrimaryKeyLength() const
s
Definition: GpgKey.cpp:113
std::string GetPublicKeyAlgo() const
Definition: GpgKey.cpp:96
boost::posix_time::ptime GetExpireTime() const
Definition: GpgKey.cpp:105
bool IsHasAuthenticationCapability() const
Definition: GpgKey.cpp:129
bool IsExpired() const
Definition: GpgKey.cpp:142
Definition: GpgSubKey.h:43
std::string GetProtocol() const
Definition: GpgKey.cpp:74
bool IsRevoked() const
Definition: GpgKey.cpp:144
std::unique_ptr< std::vector< GpgUID > > GetUIDs() const
Definition: GpgKey.cpp:163
bool IsHasEncryptionCapability() const
Definition: GpgKey.cpp:117
bool IsDisabled() const
Definition: GpgKey.cpp:146
bool IsHasCertificationCapability() const
Definition: GpgKey.cpp:125
bool IsHasMasterKey() const
Definition: GpgKey.cpp:148
boost::posix_time::ptime GetLastUpdateTime() const
Definition: GpgKey.cpp:100
std::string GetFingerprint() const
Definition: GpgKey.cpp:70
std::string GetName() const
Definition: GpgKey.cpp:58