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(); }
111 GpgContextInitArgs args_{};
112 bool extend_info_loaded_ =
false;
113 std::shared_mutex preload_lock_{};
119 void post_init_ctx();
126 std::string need_user_input_passphrase();
132 std::optional<std::string> check_binary_chacksum(std::filesystem::path);
139 void operator()(gpgme_ctx_t _ctx);
142 using CtxRefHandler =
143 std::unique_ptr<struct gpgme_context, _ctx_ref_deleter>;
144 CtxRefHandler _ctx_ref =
nullptr;
152 void SignalNeedUserInputPassphrase();
165 static gpgme_error_t test_passphrase_cb(
void* opaque,
const char* uid_hint,
166 const char* passphrase_info,
167 int last_was_bad,
int fd);
179 static gpgme_error_t custom_passphrase_cb(
void* opaque,
const char* uid_hint,
180 const char* passphrase_info,
181 int last_was_bad,
int fd);
191 static gpgme_error_t test_status_cb(
void* hook,
const char* keyword,
199 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:40
Definition: GpgFunctionObject.h:150
Definition: CoreCommonUtil.cpp:31
Definition: GpgContext.h:46
Definition: GpgContext.h:138