29 #ifndef __SGPGMEPP_CONTEXT_H__
30 #define __SGPGMEPP_CONTEXT_H__
35 #include "GpgConstants.h"
36 #include "GpgFunctionObject.h"
48 bool independent_database =
false;
49 std::string db_path = {};
50 bool gpg_alone =
false;
51 std::string gpg_path = {};
52 bool test_mode =
false;
93 [[nodiscard]]
bool good()
const;
100 [[nodiscard]]
const GpgInfo& GetInfo(
bool refresh =
false);
107 operator gpgme_ctx_t()
const {
return _ctx_ref.get(); }
112 bool extend_info_loaded_ =
false;
118 void post_init_ctx();
125 std::string need_user_input_passphrase();
131 std::optional<std::string> check_binary_chacksum(std::filesystem::path);
138 void operator()(gpgme_ctx_t _ctx);
141 using CtxRefHandler =
142 std::unique_ptr<struct gpgme_context, _ctx_ref_deleter>;
143 CtxRefHandler _ctx_ref =
nullptr;
151 void SignalNeedUserInputPassphrase();
164 static gpgme_error_t test_passphrase_cb(
void* opaque,
const char* uid_hint,
165 const char* passphrase_info,
166 int last_was_bad,
int fd);
178 static gpgme_error_t custom_passphrase_cb(
void* opaque,
const char* uid_hint,
179 const char* passphrase_info,
180 int last_was_bad,
int fd);
190 static gpgme_error_t test_status_cb(
void* hook,
const char* keyword,
198 void SetPassphraseCb(gpgme_passphrase_cb_t func)
const;
Definition: GpgContext.h:64
~GpgContext() override=default
Destroy the Gpg Context object.
Use to record some info about gnupg.
Definition: GpgInfo.h:39
Definition: GpgFunctionObject.h:148
Definition: CoreCommonUtil.cpp:31
Definition: GpgContext.h:46
Definition: GpgContext.h:137