aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/gpg/GpgKeyManager.h
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-11-26 22:04:00 +0000
committersaturneric <[email protected]>2024-11-26 22:07:04 +0000
commitaf776283bd5d50363c8777dbb3524fde417cc368 (patch)
treea633e2e8161dc7b9048af25d81e284c116e217cc /src/core/function/gpg/GpgKeyManager.h
parentfeat: support eml data decryption (diff)
downloadGpgFrontend-af776283bd5d50363c8777dbb3524fde417cc368.tar.gz
GpgFrontend-af776283bd5d50363c8777dbb3524fde417cc368.zip
feat: support uid revoke and uid delete operations
Diffstat (limited to 'src/core/function/gpg/GpgKeyManager.h')
-rw-r--r--src/core/function/gpg/GpgKeyManager.h57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/core/function/gpg/GpgKeyManager.h b/src/core/function/gpg/GpgKeyManager.h
index 986e835f..7bd45a1c 100644
--- a/src/core/function/gpg/GpgKeyManager.h
+++ b/src/core/function/gpg/GpgKeyManager.h
@@ -28,8 +28,6 @@
#pragma once
-#include <functional>
-
#include "core/function/basic/GpgFunctionObject.h"
#include "core/function/gpg/GpgContext.h"
#include "core/typedef/GpgTypedef.h"
@@ -113,61 +111,6 @@ class GPGFRONTEND_CORE_EXPORT GpgKeyManager
const QString& reason_text) -> bool;
private:
- static auto interactor_cb_fnc(void* handle, const char* status,
- const char* args, int fd) -> gpgme_error_t;
-
- using Command = QString;
- using AutomatonState = enum {
- AS_START,
- AS_SELECT,
- AS_COMMAND,
- AS_VALUE,
- AS_REASON_CODE,
- AS_REASON_TEXT,
- AS_REALLY_ULTIMATE,
- AS_SAVE,
- AS_ERROR,
- AS_QUIT,
- };
-
- struct AutomatonHandelStruct;
-
- using AutomatonActionHandler =
- std::function<Command(AutomatonHandelStruct&, AutomatonState)>;
- using AutomatonNextStateHandler =
- std::function<AutomatonState(AutomatonState, QString, QString)>;
-
- struct AutomatonHandelStruct {
- void SetStatus(AutomatonState next_state) { current_state_ = next_state; }
- auto CurrentStatus() -> AutomatonState { return current_state_; }
- void SetHandler(AutomatonNextStateHandler next_state_handler,
- AutomatonActionHandler action_handler) {
- next_state_handler_ = std::move(next_state_handler);
- action_handler_ = std::move(action_handler);
- }
- auto NextState(QString gpg_status, QString args) -> AutomatonState {
- return next_state_handler_(current_state_, std::move(gpg_status),
- std::move(args));
- }
- auto Action() -> Command { return action_handler_(*this, current_state_); }
-
- void SetSuccess(bool success) { success_ = success; }
-
- [[nodiscard]] auto Success() const -> bool { return success_; }
-
- auto KeyFpr() -> QString { return key_fpr_; }
-
- explicit AutomatonHandelStruct(QString key_fpr)
- : key_fpr_(std::move(key_fpr)) {}
-
- private:
- AutomatonState current_state_ = AS_START;
- AutomatonNextStateHandler next_state_handler_;
- AutomatonActionHandler action_handler_;
- bool success_ = false;
- QString key_fpr_;
- };
-
GpgContext& ctx_ =
GpgContext::GetInstance(SingletonFunctionObject::GetChannel()); ///<
};