GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgBasicOperator.h
1 
29 #pragma once
30 
31 #include "core/function/basic/GpgFunctionObject.h"
32 #include "core/function/gpg/GpgContext.h"
33 #include "core/function/result_analyse/GpgResultAnalyse.h"
34 #include "core/model/GFBuffer.h"
35 #include "core/typedef/CoreTypedef.h"
36 #include "core/typedef/GpgTypedef.h"
37 
38 namespace GpgFrontend {
39 
44 class GPGFRONTEND_CORE_EXPORT GpgBasicOperator
45  : public SingletonFunctionObject<GpgBasicOperator> {
46  public:
52  explicit GpgBasicOperator(
54 
59  void Encrypt(const KeyArgsList&, const GFBuffer&, bool,
60  const GpgOperationCallback&);
61 
66  auto EncryptSync(const KeyArgsList&, const GFBuffer&, bool)
67  -> std::tuple<GpgError, DataObjectPtr>;
68 
77  void EncryptSymmetric(const GFBuffer& in_buffer, bool ascii,
78  const GpgOperationCallback& cb);
79 
88  auto EncryptSymmetricSync(const GFBuffer& in_buffer, bool ascii)
89  -> std::tuple<GpgError, DataObjectPtr>;
90 
102  void EncryptSign(const KeyArgsList& keys, const KeyArgsList& signers,
103  const GFBuffer& in_buffer, bool ascii,
104  const GpgOperationCallback& cb);
105 
115  auto EncryptSignSync(const KeyArgsList& keys, const KeyArgsList& signers,
116  const GFBuffer& in_buffer, bool ascii)
117  -> std::tuple<GpgError, DataObjectPtr>;
118 
127  void Decrypt(const GFBuffer& in_buffer, const GpgOperationCallback& cb);
128 
134  auto DecryptSync(const GFBuffer& in_buffer)
135  -> std::tuple<GpgError, DataObjectPtr>;
136 
147  void DecryptVerify(const GFBuffer& in_buffer, const GpgOperationCallback& cb);
148 
154  auto DecryptVerifySync(const GFBuffer& in_buffer)
155  -> std::tuple<GpgError, DataObjectPtr>;
156 
165  void Verify(const GFBuffer& in_buffer, const GFBuffer& sig_buffer,
166  const GpgOperationCallback& cb);
167 
176  auto VerifySync(const GFBuffer& in_buffer, const GFBuffer& sig_buffer)
177  -> std::tuple<GpgError, DataObjectPtr>;
178 
199  void Sign(const KeyArgsList& signers, const GFBuffer& in_buffer,
200  GpgSignMode mode, bool ascii, const GpgOperationCallback& cb);
201 
212  auto SignSync(const KeyArgsList& signers, const GFBuffer& in_buffer,
213  GpgSignMode mode, bool ascii)
214  -> std::tuple<GpgError, DataObjectPtr>;
215 
222  void SetSigners(const KeyArgsList& signers, bool ascii);
223 
229  auto GetSigners(bool ascii) -> std::unique_ptr<KeyArgsList>;
230 
231  private:
234 };
235 } // namespace GpgFrontend
Definition: GFBuffer.h:36
Basic operation collection.
Definition: GpgBasicOperator.h:45
Definition: GpgContext.h:60
Definition: GpgFunctionObject.h:57
auto GetChannel() const -> int
Get the Channel object.
Definition: GpgFunctionObject.h:139
static auto GetInstance(int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> GpgContext &
Get the Instance object.
Definition: GpgFunctionObject.h:79
static auto GetDefaultChannel() -> int
Get the Default Channel object.
Definition: GpgFunctionObject.h:130
Definition: app.cpp:39