GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
GpgKeyOpera.h
1 
29 #pragma once
30 
31 #include <functional>
32 
33 #include "core/function/gpg/GpgContext.h"
34 #include "core/typedef/GpgTypedef.h"
35 
36 namespace GpgFrontend {
41 class GenKeyInfo;
42 
47 class GPGFRONTEND_CORE_EXPORT GpgKeyOpera
48  : public SingletonFunctionObject<GpgKeyOpera> {
49  public:
55  explicit GpgKeyOpera(
57 
63  void DeleteKeys(KeyIdArgsListPtr key_ids);
64 
70  void DeleteKey(const KeyId& key_id);
71 
80  auto SetExpire(const GpgKey& key, const SubkeyId& subkey_fpr,
81  std::unique_ptr<QDateTime>& expires) -> GpgError;
82 
89  void GenerateRevokeCert(const GpgKey& key, const QString& output_path);
90 
97  void ModifyPassword(const GpgKey& key, const GpgOperationCallback&);
98 
106  auto ModifyTOFUPolicy(const GpgKey& key, gpgme_tofu_policy_t tofu_policy)
115  void GenerateKey(const std::shared_ptr<GenKeyInfo>&,
116  const GpgOperationCallback&);
117 
123  auto GenerateKeySync(const std::shared_ptr<GenKeyInfo>& params)
124  -> std::tuple<GpgError, DataObjectPtr>;
125 
133  void GenerateSubkey(const GpgKey& key,
134  const std::shared_ptr<GenKeyInfo>& params,
135  const GpgOperationCallback&);
136 
143  auto GenerateSubkeySync(const GpgKey& key,
144  const std::shared_ptr<GenKeyInfo>& params)
145  -> std::tuple<GpgError, DataObjectPtr>;
146 
154  void GenerateKeyWithSubkey(const std::shared_ptr<GenKeyInfo>& params,
155  const std::shared_ptr<GenKeyInfo>& subkey_params,
156  const GpgOperationCallback& callback);
157 
165  auto GenerateKeyWithSubkeySync(
166  const std::shared_ptr<GenKeyInfo>& params,
167  const std::shared_ptr<GenKeyInfo>& subkey_params)
168  -> std::tuple<GpgError, DataObjectPtr>;
169 
170  private:
171  GpgContext& ctx_ =
173 };
174 } // namespace GpgFrontend
Definition: GpgContext.h:58
Definition: GpgKeyOpera.h:48
Definition: GpgKey.h:40
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
gpgme_error_t GpgError
gpgme error
Definition: GpgTypedef.h:42