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 <boost/date_time.hpp>
33 #include <boost/date_time/posix_time/conversion.hpp>
35 #include "GpgSubKey.h"
44 class 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);
289 GpgKey(
const gpgme_key_t& key) =
delete;
312 GpgKey& operator=(
const gpgme_key_t& key) =
delete;
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;
363 #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