GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgKeySignature.h
1
29#ifndef GPGFRONTEND_GPGKEYSIGNATURE_H
30#define GPGFRONTEND_GPGKEYSIGNATURE_H
31
32#include <boost/date_time.hpp>
33#include <string>
34
35#include "core/GpgConstants.h"
36
41namespace GpgFrontend {
42
47class GPGFRONTEND_CORE_EXPORT GpgKeySignature {
48 public:
55 [[nodiscard]] bool IsRevoked() const;
56
63 [[nodiscard]] bool IsExpired() const;
64
71 [[nodiscard]] bool IsInvalid() const;
72
79 [[nodiscard]] bool IsExportable() const;
80
86 [[nodiscard]] gpgme_error_t GetStatus() const;
87
93 [[nodiscard]] std::string GetKeyID() const;
94
100 [[nodiscard]] std::string GetPubkeyAlgo() const;
101
107 [[nodiscard]] boost::posix_time::ptime GetCreateTime() const;
108
114 [[nodiscard]] boost::posix_time::ptime GetExpireTime() const;
115
121 [[nodiscard]] std::string GetUID() const;
122
128 [[nodiscard]] std::string GetName() const;
129
135 [[nodiscard]] std::string GetEmail() const;
136
142 [[nodiscard]] std::string GetComment() const;
143
149
155
161 explicit GpgKeySignature(gpgme_key_sig_t sig);
162
168
174
180 GpgKeySignature &operator=(GpgKeySignature &&) noexcept;
181
187 GpgKeySignature &operator=(const GpgKeySignature &) = delete;
188
189 private:
190 using KeySignatrueRefHandler =
191 std::unique_ptr<struct _gpgme_key_sig,
192 std::function<void(gpgme_key_sig_t)>>;
193
194 KeySignatrueRefHandler signature_ref_ = nullptr;
195};
196
197} // namespace GpgFrontend
198
199#endif // GPGFRONTEND_GPGKEYSIGNATURE_H
Definition: GpgKeySignature.h:47
GpgKeySignature()
Construct a new Gpg Key Signature object.
GpgKeySignature(GpgKeySignature &&) noexcept
Construct a new Gpg Key Signature object.
~GpgKeySignature()
Destroy the Gpg Key Signature object.
Definition: CoreCommonUtil.cpp:29