GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgFileOpera.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/typedef/GpgTypedef.h"
35 
36 namespace GpgFrontend {
37 
43 class GPGFRONTEND_CORE_EXPORT GpgFileOpera
44  : public SingletonFunctionObject<GpgFileOpera> {
45  public:
51  explicit GpgFileOpera(
53 
64  void EncryptFile(const KeyArgsList& keys, const QString& in_path, bool ascii,
65  const QString& out_path, const GpgOperationCallback& cb);
66 
76  auto EncryptFileSync(const KeyArgsList& keys, const QString& in_path,
77  bool ascii, const QString& out_path)
78  -> std::tuple<GpgError, DataObjectPtr>;
79 
89  void EncryptDirectory(const KeyArgsList& keys, const QString& in_path,
90  bool ascii, const QString& out_path,
91  const GpgOperationCallback& cb);
92 
102  void EncryptFileSymmetric(const QString& in_path, bool ascii,
103  const QString& out_path,
104  const GpgOperationCallback& cb);
105 
114  auto EncryptFileSymmetricSync(const QString& in_path, bool ascii,
115  const QString& out_path)
116  -> std::tuple<GpgError, DataObjectPtr>;
117 
126  void EncryptDerectorySymmetric(const QString& in_path, bool ascii,
127  const QString& out_path,
128  const GpgOperationCallback& cb);
129 
137  auto EncryptDerectorySymmetricSync(const QString& in_path, bool ascii,
138  const QString& out_path)
139  -> std::tuple<GpgError, DataObjectPtr>;
140 
149  void DecryptFile(const QString& in_path, const QString& out_path,
150  const GpgOperationCallback& cb);
151 
160  auto DecryptFileSync(const QString& in_path, const QString& out_path)
161  -> std::tuple<GpgError, DataObjectPtr>;
162 
170  void DecryptArchive(const QString& in_path, const QString& out_path,
171  const GpgOperationCallback& cb);
172 
183  void SignFile(const KeyArgsList& keys, const QString& in_path, bool ascii,
184  const QString& out_path, const GpgOperationCallback& cb);
185 
195  auto SignFileSync(const KeyArgsList& keys, const QString& in_path, bool ascii,
196  const QString& out_path)
197  -> std::tuple<GpgError, DataObjectPtr>;
198 
208  void VerifyFile(const QString& data_path, const QString& sign_path,
209  const GpgOperationCallback& cb);
210 
218  auto VerifyFileSync(const QString& data_path, const QString& sign_path)
219  -> std::tuple<GpgError, DataObjectPtr>;
220 
231  void EncryptSignFile(const KeyArgsList& keys, const KeyArgsList& signer_keys,
232  const QString& in_path, bool ascii,
233  const QString& out_path, const GpgOperationCallback& cb);
234 
244  auto EncryptSignFileSync(const KeyArgsList& keys,
245  const KeyArgsList& signer_keys,
246  const QString& in_path, bool ascii,
247  const QString& out_path)
248  -> std::tuple<GpgError, DataObjectPtr>;
249 
260  void EncryptSignDirectory(const KeyArgsList& keys,
261  const KeyArgsList& signer_keys,
262  const QString& in_path, bool ascii,
263  const QString& out_path,
264  const GpgOperationCallback& cb);
265 
275  void DecryptVerifyFile(const QString& in_path, const QString& out_path,
276  const GpgOperationCallback& cb);
277 
284  auto DecryptVerifyFileSync(const QString& in_path, const QString& out_path)
285  -> std::tuple<GpgError, DataObjectPtr>;
286 
294  void DecryptVerifyArchive(const QString& in_path, const QString& out_path,
295  const GpgOperationCallback& cb);
296 
297  private:
300 };
301 
302 } // namespace GpgFrontend
Definition: GpgContext.h:58
Definition: GpgFileOpera.h:44
Definition: GpgFunctionObject.h:58
auto GetChannel() const -> int
Get the Channel object.
Definition: GpgFunctionObject.h:140
static auto GetInstance(int channel=GpgFrontend::kGpgFrontendDefaultChannel) -> GpgContext &
Get the Instance object.
Definition: GpgFunctionObject.h:80
static auto GetDefaultChannel() -> int
Get the Default Channel object.
Definition: GpgFunctionObject.h:131
Definition: app.cpp:39