198 lines
20 KiB
HTML
198 lines
20 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.9.1"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>GpgFrontend Project: src/core/GpgContext.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">GpgFrontend Project
|
|
</div>
|
|
<div id="projectbrief">A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.1 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('GpgContext_8h_source.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">GpgContext.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>  </div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#ifndef __SGPGMEPP_CONTEXT_H__</span></div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#define __SGPGMEPP_CONTEXT_H__</span></div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  </div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <optional></span></div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <string></span></div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include "GpgFunctionObject.h"</span></div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#include "GpgInfo.h"</span></div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  </div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">namespace </span><a class="code" href="namespaceGpgFrontend.html">GpgFrontend</a> {</div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  </div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structGpgFrontend_1_1GpgContextInitArgs.html"> 44</a></span> <span class="keyword">struct </span><a class="code" href="structGpgFrontend_1_1GpgContextInitArgs.html">GpgContextInitArgs</a> {</div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment">// make no sense for gpg2</span></div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordtype">bool</span> independent_database = <span class="keyword">false</span>; </div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  std::string db_path = {};</div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordtype">bool</span> gpg_alone = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  std::string gpg_path = {};</div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  </div>
|
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordtype">bool</span> test_mode = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordtype">bool</span> ascii = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordtype">bool</span> offline_mode = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordtype">bool</span> auto_import_missing_key = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  </div>
|
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordtype">bool</span> custom_gpgconf = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  std::string custom_gpgconf_path;</div>
|
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  </div>
|
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordtype">bool</span> use_pinentry = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="structGpgFrontend_1_1GpgContextInitArgs.html">GpgContextInitArgs</a>() = <span class="keywordflow">default</span>;</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> };</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1GpgContext.html"> 69</a></span> <span class="keyword">class </span>GPGFRONTEND_CORE_EXPORT <a class="code" href="classGpgFrontend_1_1GpgContext.html">GpgContext</a></div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  : <span class="keyword">public</span> QObject,</div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keyword">public</span> <a class="code" href="classGpgFrontend_1_1SingletonFunctionObject.html">SingletonFunctionObject</a><GpgContext> {</div>
|
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  Q_OBJECT</div>
|
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keyword">explicit</span> <a class="code" href="classGpgFrontend_1_1GpgContext.html">GpgContext</a>(<span class="keyword">const</span> <a class="code" href="structGpgFrontend_1_1GpgContextInitArgs.html">GpgContextInitArgs</a>& args = {});</div>
|
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  </div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keyword">explicit</span> <a class="code" href="classGpgFrontend_1_1GpgContext.html">GpgContext</a>(<span class="keywordtype">int</span> channel);</div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  </div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1GpgContext.html#ae89dee551354c1541337881898832725"> 92</a></span>  <a class="code" href="classGpgFrontend_1_1GpgContext.html#ae89dee551354c1541337881898832725">~GpgContext</a>() <span class="keyword">override</span> = <span class="keywordflow">default</span>;</div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
|
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  [[nodiscard]] <span class="keywordtype">bool</span> good() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  </div>
|
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  [[nodiscard]] <span class="keyword">const</span> <a class="code" href="classGpgFrontend_1_1GpgInfo.html">GpgInfo</a>& GetInfo(<span class="keywordtype">bool</span> refresh = <span class="keyword">false</span>);</div>
|
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  </div>
|
|
<div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classGpgFrontend_1_1GpgContext.html#a5b419175bd9927f3d449637db8ba6524"> 114</a></span>  <span class="keyword">operator</span> gpgme_ctx_t()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _ctx_ref.get(); }</div>
|
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  </div>
|
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <a class="code" href="classGpgFrontend_1_1GpgInfo.html">GpgInfo</a> info_{}; </div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  GpgContextInitArgs args_{}; </div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordtype">bool</span> extend_info_loaded_ = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  std::shared_mutex preload_lock_{};</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  </div>
|
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordtype">void</span> post_init_ctx();</div>
|
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  </div>
|
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  std::string need_user_input_passphrase();</div>
|
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  </div>
|
|
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  std::optional<std::string> check_binary_chacksum(std::filesystem::path);</div>
|
|
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  </div>
|
|
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="structGpgFrontend_1_1GpgContext_1_1__ctx__ref__deleter.html"> 145</a></span>  <span class="keyword">struct </span><a class="code" href="structGpgFrontend_1_1GpgContext_1_1__ctx__ref__deleter.html">_ctx_ref_deleter</a> {</div>
|
|
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keywordtype">void</span> operator()(gpgme_ctx_t _ctx);</div>
|
|
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  };</div>
|
|
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  </div>
|
|
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keyword">using</span> CtxRefHandler =</div>
|
|
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  std::unique_ptr<struct gpgme_context, _ctx_ref_deleter>; </div>
|
|
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  CtxRefHandler _ctx_ref = <span class="keyword">nullptr</span>; </div>
|
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordtype">bool</span> good_ = <span class="keyword">true</span>; </div>
|
|
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  </div>
|
|
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  signals:</div>
|
|
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordtype">void</span> SignalNeedUserInputPassphrase();</div>
|
|
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  </div>
|
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  <span class="keyword">static</span> gpgme_error_t test_passphrase_cb(<span class="keywordtype">void</span>* opaque, <span class="keyword">const</span> <span class="keywordtype">char</span>* uid_hint,</div>
|
|
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* passphrase_info,</div>
|
|
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keywordtype">int</span> last_was_bad, <span class="keywordtype">int</span> fd);</div>
|
|
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  </div>
|
|
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="keyword">static</span> gpgme_error_t custom_passphrase_cb(<span class="keywordtype">void</span>* opaque, <span class="keyword">const</span> <span class="keywordtype">char</span>* uid_hint,</div>
|
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* passphrase_info,</div>
|
|
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordtype">int</span> last_was_bad, <span class="keywordtype">int</span> fd);</div>
|
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  </div>
|
|
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keyword">static</span> gpgme_error_t test_status_cb(<span class="keywordtype">void</span>* hook, <span class="keyword">const</span> <span class="keywordtype">char</span>* keyword,</div>
|
|
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* args);</div>
|
|
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  </div>
|
|
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordtype">void</span> SetPassphraseCb(gpgme_passphrase_cb_t func) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span> };</div>
|
|
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span> } <span class="comment">// namespace GpgFrontend</span></div>
|
|
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  </div>
|
|
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span> <span class="preprocessor">#endif </span><span class="comment">// __SGPGMEPP_CONTEXT_H__</span></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1GpgContext_html"><div class="ttname"><a href="classGpgFrontend_1_1GpgContext.html">GpgFrontend::GpgContext</a></div><div class="ttdef"><b>Definition:</b> GpgContext.h:71</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1GpgContext_html_ae89dee551354c1541337881898832725"><div class="ttname"><a href="classGpgFrontend_1_1GpgContext.html#ae89dee551354c1541337881898832725">GpgFrontend::GpgContext::~GpgContext</a></div><div class="ttdeci">~GpgContext() override=default</div><div class="ttdoc">Destroy the Gpg Context object.</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1GpgInfo_html"><div class="ttname"><a href="classGpgFrontend_1_1GpgInfo.html">GpgFrontend::GpgInfo</a></div><div class="ttdoc">Use to record some info about gnupg.</div><div class="ttdef"><b>Definition:</b> GpgInfo.h:40</div></div>
|
|
<div class="ttc" id="aclassGpgFrontend_1_1SingletonFunctionObject_html"><div class="ttname"><a href="classGpgFrontend_1_1SingletonFunctionObject.html">GpgFrontend::SingletonFunctionObject</a></div><div class="ttdef"><b>Definition:</b> GpgFunctionObject.h:150</div></div>
|
|
<div class="ttc" id="anamespaceGpgFrontend_html"><div class="ttname"><a href="namespaceGpgFrontend.html">GpgFrontend</a></div><div class="ttdef"><b>Definition:</b> CoreCommonUtil.cpp:31</div></div>
|
|
<div class="ttc" id="astructGpgFrontend_1_1GpgContextInitArgs_html"><div class="ttname"><a href="structGpgFrontend_1_1GpgContextInitArgs.html">GpgFrontend::GpgContextInitArgs</a></div><div class="ttdef"><b>Definition:</b> GpgContext.h:44</div></div>
|
|
<div class="ttc" id="astructGpgFrontend_1_1GpgContext_1_1__ctx__ref__deleter_html"><div class="ttname"><a href="structGpgFrontend_1_1GpgContext_1_1__ctx__ref__deleter.html">GpgFrontend::GpgContext::_ctx_ref_deleter</a></div><div class="ttdef"><b>Definition:</b> GpgContext.h:145</div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_aebb8dcc11953d78e620bbef0b9e2183.html">core</a></li><li class="navelem"><b>GpgContext.h</b></li>
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|