GpgSubKey.h
#ifndef GPGFRONTEND_GPGSUBKEY_H
#define GPGFRONTEND_GPGSUBKEY_H
#include <boost/date_time.hpp>
#include <string>
#include "core/GpgConstants.h"
namespace GpgFrontend {
class GPGFRONTEND_CORE_EXPORT GpgSubKey {
public:
[[nodiscard]] std::string GetID() const;
[[nodiscard]] std::string GetFingerprint() const;
[[nodiscard]] std::string GetPubkeyAlgo() const;
[[nodiscard]] unsigned int GetKeyLength() const;
[[nodiscard]] bool IsHasEncryptionCapability() const;
[[nodiscard]] bool IsHasSigningCapability() const;
[[nodiscard]] bool IsHasCertificationCapability() const;
[[nodiscard]] bool IsHasAuthenticationCapability() const;
[[nodiscard]] bool IsPrivateKey() const;
[[nodiscard]] bool IsExpired() const;
[[nodiscard]] bool IsRevoked() const;
[[nodiscard]] bool IsDisabled() const;
[[nodiscard]] bool IsSecretKey() const;
[[nodiscard]] bool IsCardKey() const;
[[nodiscard]] boost::posix_time::ptime GetCreateTime() const;
[[nodiscard]] boost::posix_time::ptime GetExpireTime() const;
GpgSubKey();
explicit GpgSubKey(gpgme_subkey_t subkey);
GpgSubKey(GpgSubKey&& o) noexcept;
GpgSubKey(const GpgSubKey&) = delete;
GpgSubKey& operator=(GpgSubKey&& o) noexcept;
GpgSubKey& operator=(const GpgSubKey&) = delete;
bool operator==(const GpgSubKey& o) const;
private:
using SubkeyRefHandler =
std::unique_ptr<struct _gpgme_subkey,
std::function<void(gpgme_subkey_t)>>;
SubkeyRefHandler _subkey_ref = nullptr;
};
} // namespace GpgFrontend
#endif // GPGFRONTEND_GPGSUBKEY_H
GpgFrontend::GpgSubKey::IsHasEncryptionCapability
bool IsHasEncryptionCapability() const
Definition: GpgSubKey.cpp:63
GpgFrontend::GpgSubKey::operator==
bool operator==(const GpgSubKey &o) const
Definition: GpgSubKey.cpp:45
GpgFrontend::GpgSubKey::GetKeyLength
unsigned int GetKeyLength() const
Definition: GpgSubKey.cpp:59
GpgFrontend
Definition: CoreCommonUtil.cpp:29
GpgFrontend::GpgSubKey::GpgSubKey
GpgSubKey()
Construct a new Gpg Sub Key object.
GpgFrontend::GpgSubKey::GetID
std::string GetID() const
Definition: GpgSubKey.cpp:49
GpgFrontend::GpgSubKey::IsExpired
bool IsExpired() const
Definition: GpgSubKey.cpp:83
GpgFrontend::GpgSubKey::operator=
GpgSubKey & operator=(GpgSubKey &&o) noexcept
Definition: GpgSubKey.cpp:39
GpgFrontend::GpgSubKey::IsSecretKey
bool IsSecretKey() const
Definition: GpgSubKey.cpp:91
GpgFrontend::GpgSubKey::IsHasCertificationCapability
bool IsHasCertificationCapability() const
Definition: GpgSubKey.cpp:71
GpgFrontend::GpgSubKey::IsDisabled
bool IsDisabled() const
Definition: GpgSubKey.cpp:87
GpgFrontend::GpgSubKey::GetFingerprint
std::string GetFingerprint() const
Definition: GpgSubKey.cpp:51
GpgFrontend::GpgSubKey::IsCardKey
bool IsCardKey() const
Definition: GpgSubKey.cpp:93
GpgFrontend::GpgSubKey::GetExpireTime
boost::posix_time::ptime GetExpireTime() const
Definition: GpgSubKey.cpp:101
GpgFrontend::GpgSubKey::IsRevoked
bool IsRevoked() const
Definition: GpgSubKey.cpp:85
GpgFrontend::GpgSubKey
Definition: GpgSubKey.h:43
GpgFrontend::GpgSubKey::IsHasAuthenticationCapability
bool IsHasAuthenticationCapability() const
Definition: GpgSubKey.cpp:75
GpgFrontend::GpgSubKey::GetPubkeyAlgo
std::string GetPubkeyAlgo() const
Definition: GpgSubKey.cpp:55
GpgFrontend::GpgSubKey::GetCreateTime
boost::posix_time::ptime GetCreateTime() const
Definition: GpgSubKey.cpp:97
GpgFrontend::GpgSubKey::IsPrivateKey
bool IsPrivateKey() const
Definition: GpgSubKey.cpp:79
GpgFrontend::GpgSubKey::IsHasSigningCapability
bool IsHasSigningCapability() const
Definition: GpgSubKey.cpp:67