GpgKey.h
#ifndef GPGFRONTEND_GPGKEY_H
#define GPGFRONTEND_GPGKEY_H
#include "GpgSubKey.h"
#include "GpgUID.h"
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT GpgKey {
public:
[[nodiscard]] bool IsGood() const;
[[nodiscard]] std::string GetId() const;
[[nodiscard]] std::string GetName() const;
[[nodiscard]] std::string GetEmail() const;
[[nodiscard]] std::string GetComment() const;
[[nodiscard]] std::string GetFingerprint() const;
[[nodiscard]] std::string GetProtocol() const;
[[nodiscard]] std::string GetOwnerTrust() const;
[[nodiscard]] std::string GetPublicKeyAlgo() const;
[[nodiscard]] boost::posix_time::ptime GetLastUpdateTime() const;
[[nodiscard]] boost::posix_time::ptime GetExpireTime() const;
[[nodiscard]] boost::posix_time::ptime GetCreateTime() const;
[[nodiscard]] unsigned int GetPrimaryKeyLength() const;
[[nodiscard]] bool IsHasEncryptionCapability() const;
[[nodiscard]] bool IsHasActualEncryptionCapability() const;
[[nodiscard]] bool IsHasSigningCapability() const;
[[nodiscard]] bool IsHasActualSigningCapability() const;
[[nodiscard]] bool IsHasCertificationCapability() const;
[[nodiscard]] bool IsHasActualCertificationCapability() const;
[[nodiscard]] bool IsHasAuthenticationCapability() const;
[[nodiscard]] bool IsHasActualAuthenticationCapability() const;
[[nodiscard]] bool IsHasCardKey() const;
[[nodiscard]] bool IsPrivateKey() const;
[[nodiscard]] bool IsExpired() const;
[[nodiscard]] bool IsRevoked() const;
[[nodiscard]] bool IsDisabled() const;
[[nodiscard]] bool IsHasMasterKey() const;
[[nodiscard]] std::unique_ptr<std::vector<GpgSubKey>> GetSubKeys() const;
[[nodiscard]] std::unique_ptr<std::vector<GpgUID>> GetUIDs() const;
GpgKey() = default;
explicit GpgKey(gpgme_key_t&& key);
~GpgKey() = default;
GpgKey(const gpgme_key_t& key) = delete;
GpgKey(GpgKey&& k) noexcept;
GpgKey& operator=(GpgKey&& k) noexcept;
GpgKey& operator=(const gpgme_key_t& key) = delete;
bool operator==(const GpgKey& o) const;
bool operator<=(const GpgKey& o) const;
explicit operator gpgme_key_t() const;
[[nodiscard]] GpgKey Copy() const;
private:
struct GPGFRONTEND_CORE_EXPORT _key_ref_deleter {
void operator()(gpgme_key_t _key);
};
using KeyRefHandler =
std::unique_ptr<struct _gpgme_key, _key_ref_deleter>;
KeyRefHandler key_ref_ = nullptr;
};
} // namespace GpgFrontend
#endif // GPGFRONTEND_GPGKEY_H
GpgFrontend::GpgKey::IsHasCardKey
bool IsHasCardKey() const
Definition: GpgKey.cpp:131
GpgFrontend::GpgKey::GpgKey
GpgKey()=default
Construct a new Gpg Key object.
GpgFrontend::GpgKey::operator=
GpgKey & operator=(GpgKey &&k) noexcept
Definition: GpgKey.cpp:35
GpgFrontend::GpgKey::GetId
std::string GetId() const
Definition: GpgKey.cpp:52
GpgFrontend::GpgKey::IsHasSigningCapability
bool IsHasSigningCapability() const
Definition: GpgKey.cpp:119
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::GpgKey::IsHasActualCertificationCapability
bool IsHasActualCertificationCapability() const
Definition: GpgKey.cpp:205
GpgFrontend::GpgKey::_key_ref_deleter
Definition: GpgKey.h:348
GpgFrontend::GpgKey::Copy
GpgKey Copy() const
Definition: GpgKey.cpp:227
GpgFrontend::GpgKey::GetComment
std::string GetComment() const
Definition: GpgKey.cpp:64
GpgFrontend::GpgKey::operator<=
bool operator<=(const GpgKey &o) const
Definition: GpgKey.cpp:44
GpgFrontend::GpgKey::GetEmail
std::string GetEmail() const
Definition: GpgKey.cpp:60
GpgFrontend::GpgKey::GetSubKeys
std::unique_ptr< std::vector< GpgSubKey > > GetSubKeys() const
Definition: GpgKey.cpp:151
GpgFrontend::GpgKey::GetOwnerTrust
std::string GetOwnerTrust() const
Definition: GpgKey.cpp:76
GpgFrontend::GpgKey::GetCreateTime
boost::posix_time::ptime GetCreateTime() const
Create a time object.
Definition: GpgKey.cpp:107
GpgFrontend::GpgKey::IsGood
bool IsGood() const
Definition: GpgKey.cpp:50
GpgFrontend::GpgKey::IsHasActualEncryptionCapability
bool IsHasActualEncryptionCapability() const
Definition: GpgKey.cpp:214
GpgFrontend::GpgKey::operator==
bool operator==(const GpgKey &o) const
Definition: GpgKey.cpp:40
GpgFrontend::GpgKey::IsHasActualSigningCapability
bool IsHasActualSigningCapability() const
Definition: GpgKey.cpp:172
GpgFrontend::GpgKey::IsHasActualAuthenticationCapability
bool IsHasActualAuthenticationCapability() const
Definition: GpgKey.cpp:186
GpgFrontend::GpgKey::IsPrivateKey
bool IsPrivateKey() const
Definition: GpgKey.cpp:138
GpgFrontend::GpgKey::GetPrimaryKeyLength
unsigned int GetPrimaryKeyLength() const
s
Definition: GpgKey.cpp:111
GpgFrontend::GpgKey::GetPublicKeyAlgo
std::string GetPublicKeyAlgo() const
Definition: GpgKey.cpp:94
GpgFrontend::GpgKey::GetExpireTime
boost::posix_time::ptime GetExpireTime() const
Definition: GpgKey.cpp:103
GpgFrontend::GpgKey::IsHasAuthenticationCapability
bool IsHasAuthenticationCapability() const
Definition: GpgKey.cpp:127
GpgFrontend::GpgKey::IsExpired
bool IsExpired() const
Definition: GpgKey.cpp:140
GpgFrontend::GpgSubKey
Definition: GpgSubKey.h:43
GpgFrontend::GpgKey::GetProtocol
std::string GetProtocol() const
Definition: GpgKey.cpp:72
GpgFrontend::GpgUID
Definition: GpgUID.h:40
GpgFrontend::GpgKey::IsRevoked
bool IsRevoked() const
Definition: GpgKey.cpp:142
GpgFrontend::GpgKey::GetUIDs
std::unique_ptr< std::vector< GpgUID > > GetUIDs() const
Definition: GpgKey.cpp:161
GpgFrontend::GpgKey::IsHasEncryptionCapability
bool IsHasEncryptionCapability() const
Definition: GpgKey.cpp:115
GpgFrontend::GpgKey::IsDisabled
bool IsDisabled() const
Definition: GpgKey.cpp:144
GpgFrontend::GpgKey::IsHasCertificationCapability
bool IsHasCertificationCapability() const
Definition: GpgKey.cpp:123
GpgFrontend::GpgKey::IsHasMasterKey
bool IsHasMasterKey() const
Definition: GpgKey.cpp:146
GpgFrontend::GpgKey::GetLastUpdateTime
boost::posix_time::ptime GetLastUpdateTime() const
Definition: GpgKey.cpp:98
GpgFrontend::GpgKey::GetFingerprint
std::string GetFingerprint() const
Definition: GpgKey.cpp:68
GpgFrontend::GpgKey
Definition: GpgKey.h:41
GpgFrontend::GpgKey::GetName
std::string GetName() const
Definition: GpgKey.cpp:56