GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgKeyImportExporter.h
1 
29 #pragma once
30 
31 #include "core/function/basic/GpgFunctionObject.h"
32 #include "core/function/gpg/GpgContext.h"
33 #include "core/model/GFBuffer.h"
34 #include "core/typedef/GpgTypedef.h"
35 
36 namespace GpgFrontend {
37 
38 class GpgImportInformation;
39 
44 class GPGFRONTEND_CORE_EXPORT GpgKeyImportExporter
45  : public SingletonFunctionObject<GpgKeyImportExporter> {
46  public:
52  explicit GpgKeyImportExporter(
54 
61  auto ImportKey(const GFBuffer&) -> std::shared_ptr<GpgImportInformation>;
62 
71  [[nodiscard]] auto ExportKey(const GpgKey& key, bool secret, bool ascii,
72  bool shortest, bool ssh_mode = false) const
73  -> std::tuple<GpgError, GFBuffer>;
74 
84  void ExportKeys(const KeyArgsList& keys, bool secret, bool ascii,
85  bool shortest, bool ssh_mode,
86  const GpgOperationCallback& cb) const;
87 
96  void ExportAllKeys(const KeyArgsList& keys, bool secret, bool ascii,
97  const GpgOperationCallback& cb) const;
98 
99  private:
100  GpgContext& ctx_;
101 };
102 
103 } // namespace GpgFrontend
Definition: GFBuffer.h:36
Definition: GpgContext.h:58
Definition: GpgKeyImportExporter.h:45
Definition: GpgKey.h:40
Definition: GpgFunctionObject.h:58
static auto GetDefaultChannel() -> int
Get the Default Channel object.
Definition: GpgFunctionObject.h:131
Definition: app.cpp:38