GpgFrontend Project A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.

GpgBasicOperator.h
1
29 #ifndef GPGFRONTEND_ZH_CN_TS_BASICOPERATOR_H
30 #define GPGFRONTEND_ZH_CN_TS_BASICOPERATOR_H
31
32 #include "core/GpgConstants.h"
33 #include "core/GpgContext.h"
34 #include "core/GpgFunctionObject.h"
35 #include "core/GpgModel.h"
36
37 namespace GpgFrontend {
38
43 class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
44 : public SingletonFunctionObject<GpgBasicOperator> {
45 public:
51 explicit GpgBasicOperator(
52 int channel = SingletonFunctionObject::GetDefaultChannel());
53
66 gpg_error_t Encrypt(KeyListPtr keys, BypeArrayRef in_buffer,
67 ByteArrayPtr& out_buffer, GpgEncrResult& result);
68
77 gpg_error_t EncryptSymmetric(BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
78 GpgEncrResult& result);
79
93 gpgme_error_t EncryptSign(KeyListPtr keys, KeyListPtr signers,
94 BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
95 GpgEncrResult& encr_result,
96 GpgSignResult& sign_result);
97
106 gpgme_error_t Decrypt(BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
107 GpgDecrResult& result);
108
119 gpgme_error_t DecryptVerify(BypeArrayRef in_buffer, ByteArrayPtr& out_buffer,
120 GpgDecrResult& decrypt_result,
121 GpgVerifyResult& verify_result);
122
131 gpgme_error_t Verify(BypeArrayRef in_buffer, ByteArrayPtr& sig_buffer,
132 GpgVerifyResult& result) const;
133
154 gpg_error_t Sign(KeyListPtr signers, BypeArrayRef in_buffer,
155 ByteArrayPtr& out_buffer, gpgme_sig_mode_t mode,
156 GpgSignResult& result);
157
164 void SetSigners(KeyArgsList& signers);
165
171 std::unique_ptr<KeyArgsList> GetSigners();
172
173 private:
174 GpgContext& ctx_ = GpgContext::GetInstance(
175 SingletonFunctionObject::GetChannel());
176 };
177 } // namespace GpgFrontend
178
179 #endif // GPGFRONTEND_ZH_CN_TS_BASICOPERATOR_H
GpgFrontend::GpgBasicOperator
Basic operation collection.
Definition: GpgBasicOperator.h:44
GpgFrontend::GpgContext
Definition: GpgContext.h:71
GpgFrontend::SingletonFunctionObject
Definition: GpgFunctionObject.h:150
GpgFrontend::SingletonFunctionObject::GetDefaultChannel
static int GetDefaultChannel()
Get the Default Channel object.
Definition: GpgFunctionObject.h:251
GpgFrontend::SingletonFunctionObject< GpgContext >::GetInstance
static GpgContext & GetInstance(int channel=GpgFrontend::GPGFRONTEND_DEFAULT_CHANNEL)
Get the Instance object.
Definition: GpgFunctionObject.h:172
GpgFrontend::SingletonFunctionObject::GetChannel
int GetChannel() const
Get the Channel object.
Definition: GpgFunctionObject.h:258
GpgFrontend
Definition: CoreCommonUtil.cpp:31