summaryrefslogtreecommitdiff
path: root/docs/_build/html
diff options
context:
space:
mode:
authorKali Kaneko <kali@futeisha.org>2014-08-18 12:52:52 -0500
committerKali Kaneko <kali@futeisha.org>2014-08-18 12:52:52 -0500
commit315514bc033e14f34775123edab4914330213fec (patch)
treeab6237cb6fa48434f7cfc4c849eb7db16da4c217 /docs/_build/html
parentf070f3d6b39ec0dcb93df4f463280c683f9db839 (diff)
parent4bd0fa843176a112c054929fbe6dd99f45d718a2 (diff)
Merge tag 'upstream/1.3.1'
Upstream version 1.3.1
Diffstat (limited to 'docs/_build/html')
-rw-r--r--docs/_build/html/.buildinfo4
-rw-r--r--docs/_build/html/_modules/gnupg.html148
-rw-r--r--docs/_build/html/_modules/gnupg/_meta.html981
-rw-r--r--docs/_build/html/_modules/gnupg/_parsers.html1486
-rw-r--r--docs/_build/html/_modules/gnupg/_util.html718
-rw-r--r--docs/_build/html/_modules/index.html104
-rw-r--r--docs/_build/html/_sources/gnupg.txt131
-rw-r--r--docs/_build/html/_sources/index.txt44
-rw-r--r--docs/_build/html/_static/DETAILS.html2677
-rw-r--r--docs/_build/html/_static/agogo.css337
-rw-r--r--docs/_build/html/_static/ajax-loader.gifbin0 -> 673 bytes
-rw-r--r--docs/_build/html/_static/basic.css537
-rw-r--r--docs/_build/html/_static/bgfooter.pngbin0 -> 434 bytes
-rw-r--r--docs/_build/html/_static/bgtop.pngbin0 -> 430 bytes
-rw-r--r--docs/_build/html/_static/comment-bright.pngbin0 -> 3500 bytes
-rw-r--r--docs/_build/html/_static/comment-close.pngbin0 -> 3578 bytes
-rw-r--r--docs/_build/html/_static/comment.pngbin0 -> 3445 bytes
-rw-r--r--docs/_build/html/_static/doctools.js238
-rw-r--r--docs/_build/html/_static/down-pressed.pngbin0 -> 368 bytes
-rw-r--r--docs/_build/html/_static/down.pngbin0 -> 363 bytes
-rw-r--r--docs/_build/html/_static/file.pngbin0 -> 392 bytes
-rw-r--r--docs/_build/html/_static/jquery.js2
-rw-r--r--docs/_build/html/_static/minus.pngbin0 -> 199 bytes
-rw-r--r--docs/_build/html/_static/pgp-subkeys.html236
-rw-r--r--docs/_build/html/_static/plus.pngbin0 -> 199 bytes
-rw-r--r--docs/_build/html/_static/pygments.css69
-rw-r--r--docs/_build/html/_static/searchtools.js622
-rw-r--r--docs/_build/html/_static/underscore.js31
-rw-r--r--docs/_build/html/_static/up-pressed.pngbin0 -> 372 bytes
-rw-r--r--docs/_build/html/_static/up.pngbin0 -> 363 bytes
-rw-r--r--docs/_build/html/_static/websupport.js808
-rw-r--r--docs/_build/html/genindex.html932
-rw-r--r--docs/_build/html/gnupg.html2721
-rw-r--r--docs/_build/html/index.html147
-rw-r--r--docs/_build/html/objects.invbin0 -> 1574 bytes
-rw-r--r--docs/_build/html/py-modindex.html135
-rw-r--r--docs/_build/html/search.html129
-rw-r--r--docs/_build/html/searchindex.js1
38 files changed, 13238 insertions, 0 deletions
diff --git a/docs/_build/html/.buildinfo b/docs/_build/html/.buildinfo
new file mode 100644
index 0000000..473365f
--- /dev/null
+++ b/docs/_build/html/.buildinfo
@@ -0,0 +1,4 @@
+# Sphinx build info version 1
+# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: 3b17b4d3fc88986a51f33ba3cd0d93b5
+tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/_build/html/_modules/gnupg.html b/docs/_build/html/_modules/gnupg.html
new file mode 100644
index 0000000..24c2170
--- /dev/null
+++ b/docs/_build/html/_modules/gnupg.html
@@ -0,0 +1,148 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>gnupg &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '../',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="../index.html" />
+ <link rel="up" title="Module code" href="index.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="../index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>Source code for gnupg</h1><div class="highlight"><pre>
+<span class="c">#!/usr/bin/env python</span>
+<span class="c"># -*- coding: utf-8 -*-</span>
+<span class="c">#</span>
+<span class="c"># This file is part of python-gnupg, a Python interface to GnuPG.</span>
+<span class="c"># Copyright © 2013 Isis Lovecruft, &lt;isis@leap.se&gt; 0xA3ADB67A2CDB8B35</span>
+<span class="c"># © 2013 Andrej B.</span>
+<span class="c"># © 2013 LEAP Encryption Access Project</span>
+<span class="c"># © 2008-2012 Vinay Sajip</span>
+<span class="c"># © 2005 Steve Traugott</span>
+<span class="c"># © 2004 A.M. Kuchling</span>
+<span class="c">#</span>
+<span class="c"># This program is free software: you can redistribute it and/or modify it</span>
+<span class="c"># under the terms of the GNU General Public License as published by the Free</span>
+<span class="c"># Software Foundation, either version 3 of the License, or (at your option)</span>
+<span class="c"># any later version.</span>
+<span class="c">#</span>
+<span class="c"># This program is distributed in the hope that it will be useful, but WITHOUT</span>
+<span class="c"># ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
+<span class="c"># FITNESS FOR A PARTICULAR PURPOSE. See the included LICENSE file for details.</span>
+
+<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">absolute_import</span>
+
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">gnupg</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">copyleft</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_ansistrm</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_logger</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_meta</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_parsers</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_util</span>
+<span class="kn">from</span> <span class="nn">.gnupg</span> <span class="kn">import</span> <span class="n">GPG</span>
+<span class="kn">from</span> <span class="nn">._version</span> <span class="kn">import</span> <span class="n">get_versions</span>
+
+<span class="n">__version__</span> <span class="o">=</span> <span class="n">get_versions</span><span class="p">()[</span><span class="s">&#39;version&#39;</span><span class="p">]</span>
+<span class="n">__authors__</span> <span class="o">=</span> <span class="n">copyleft</span><span class="o">.</span><span class="n">authors</span>
+<span class="n">__license__</span> <span class="o">=</span> <span class="n">copyleft</span><span class="o">.</span><span class="n">full_text</span>
+<span class="n">__copyleft__</span> <span class="o">=</span> <span class="n">copyleft</span><span class="o">.</span><span class="n">copyright</span>
+
+<span class="c">## do not set __package__ = &quot;gnupg&quot;, else we will end up with</span>
+<span class="c">## gnupg.&lt;*allofthethings*&gt;</span>
+<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s">&quot;GPG&quot;</span><span class="p">,</span> <span class="s">&quot;_util&quot;</span><span class="p">,</span> <span class="s">&quot;_parsers&quot;</span><span class="p">,</span> <span class="s">&quot;_meta&quot;</span><span class="p">,</span> <span class="s">&quot;_logger&quot;</span><span class="p">]</span>
+
+<span class="c">## avoid the &quot;from gnupg import gnupg&quot; idiom</span>
+<span class="k">del</span> <span class="n">gnupg</span>
+<span class="k">del</span> <span class="n">absolute_import</span>
+<span class="k">del</span> <span class="n">copyleft</span>
+<span class="k">del</span> <span class="n">get_versions</span>
+<span class="k">del</span> <span class="n">_version</span>
+</pre></div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="../search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/_modules/gnupg/_meta.html b/docs/_build/html/_modules/gnupg/_meta.html
new file mode 100644
index 0000000..23ca880
--- /dev/null
+++ b/docs/_build/html/_modules/gnupg/_meta.html
@@ -0,0 +1,981 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>gnupg._meta &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="../../_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '../../',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="../../index.html" />
+ <link rel="up" title="gnupg" href="../gnupg.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="../../index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="../../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../../genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>Source code for gnupg._meta</h1><div class="highlight"><pre>
+<span class="c"># -*- coding: utf-8 -*-</span>
+<span class="c">#</span>
+<span class="c"># This file is part of python-gnupg, a Python interface to GnuPG.</span>
+<span class="c"># Copyright © 2013 Isis Lovecruft, &lt;isis@leap.se&gt; 0xA3ADB67A2CDB8B35</span>
+<span class="c"># © 2013 Andrej B.</span>
+<span class="c"># © 2013 LEAP Encryption Access Project</span>
+<span class="c"># © 2008-2012 Vinay Sajip</span>
+<span class="c"># © 2005 Steve Traugott</span>
+<span class="c"># © 2004 A.M. Kuchling</span>
+<span class="c">#</span>
+<span class="c"># This program is free software: you can redistribute it and/or modify it</span>
+<span class="c"># under the terms of the GNU General Public License as published by the Free</span>
+<span class="c"># Software Foundation, either version 3 of the License, or (at your option)</span>
+<span class="c"># any later version.</span>
+<span class="c">#</span>
+<span class="c"># This program is distributed in the hope that it will be useful, but WITHOUT</span>
+<span class="c"># ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
+<span class="c"># FITNESS FOR A PARTICULAR PURPOSE. See the included LICENSE file for details.</span>
+
+<span class="sd">&#39;&#39;&#39;Meta and base classes for hiding internal functions, and controlling</span>
+<span class="sd">attribute creation and handling.</span>
+<span class="sd">&#39;&#39;&#39;</span>
+
+<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">absolute_import</span>
+
+<span class="kn">import</span> <span class="nn">atexit</span>
+<span class="kn">import</span> <span class="nn">codecs</span>
+<span class="kn">import</span> <span class="nn">encodings</span>
+<span class="c">## For AOS, the locale module will need to point to a wrapper around the</span>
+<span class="c">## java.util.Locale class.</span>
+<span class="c">## See https://code.patternsinthevoid.net/?p=android-locale-hack.git</span>
+<span class="kn">import</span> <span class="nn">locale</span>
+<span class="kn">import</span> <span class="nn">os</span>
+<span class="kn">import</span> <span class="nn">platform</span>
+<span class="kn">import</span> <span class="nn">psutil</span>
+<span class="kn">import</span> <span class="nn">shlex</span>
+<span class="kn">import</span> <span class="nn">subprocess</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+<span class="kn">import</span> <span class="nn">threading</span>
+
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_parsers</span>
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_util</span>
+
+<span class="kn">from</span> <span class="nn">._parsers</span> <span class="kn">import</span> <span class="n">_check_preferences</span>
+<span class="kn">from</span> <span class="nn">._parsers</span> <span class="kn">import</span> <span class="n">_sanitise_list</span>
+<span class="kn">from</span> <span class="nn">._util</span> <span class="kn">import</span> <span class="n">log</span>
+
+
+<div class="viewcode-block" id="GPGMeta"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGMeta">[docs]</a><span class="k">class</span> <span class="nc">GPGMeta</span><span class="p">(</span><span class="nb">type</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Metaclass for changing the :meth:GPG.__init__ initialiser.</span>
+
+<span class="sd"> Detects running gpg-agent processes and the presence of a pinentry</span>
+<span class="sd"> program, and disables pinentry so that python-gnupg can write the</span>
+<span class="sd"> passphrase to the controlled GnuPG process without killing the agent.</span>
+
+<span class="sd"> :attr _agent_proc: If a :program:`gpg-agent` process is currently running</span>
+<span class="sd"> for the effective userid, then **_agent_proc** will be</span>
+<span class="sd"> set to a ``psutil.Process`` for that process.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+
+<div class="viewcode-block" id="GPGMeta.__new__"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGMeta.__new__">[docs]</a> <span class="k">def</span> <span class="nf">__new__</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">bases</span><span class="p">,</span> <span class="n">attrs</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Construct the initialiser for GPG&quot;&quot;&quot;</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Metaclass __new__ constructor called for </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">cls</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">cls</span><span class="o">.</span><span class="n">_find_agent</span><span class="p">():</span>
+ <span class="c">## call the normal GPG.__init__() initialiser:</span>
+ <span class="n">attrs</span><span class="p">[</span><span class="s">&#39;init&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">cls</span><span class="o">.</span><span class="n">__init__</span>
+ <span class="n">attrs</span><span class="p">[</span><span class="s">&#39;_remove_agent&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="nb">super</span><span class="p">(</span><span class="n">GPGMeta</span><span class="p">,</span> <span class="n">cls</span><span class="p">)</span><span class="o">.</span><span class="n">__new__</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">bases</span><span class="p">,</span> <span class="n">attrs</span><span class="p">)</span>
+</div>
+ <span class="nd">@classmethod</span>
+<div class="viewcode-block" id="GPGMeta._find_agent"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGMeta._find_agent">[docs]</a> <span class="k">def</span> <span class="nf">_find_agent</span><span class="p">(</span><span class="n">cls</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Discover if a gpg-agent process for the current euid is running.</span>
+
+<span class="sd"> If there is a matching gpg-agent process, set a :class:`psutil.Process`</span>
+<span class="sd"> instance containing the gpg-agent process&#39; information to</span>
+<span class="sd"> ``cls._agent_proc``.</span>
+
+<span class="sd"> :returns: True if there exists a gpg-agent process running under the</span>
+<span class="sd"> same effective user ID as that of this program. Otherwise,</span>
+<span class="sd"> returns None.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">identity</span> <span class="o">=</span> <span class="n">psutil</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">getpid</span><span class="p">())</span><span class="o">.</span><span class="n">uids</span>
+ <span class="k">for</span> <span class="n">proc</span> <span class="ow">in</span> <span class="n">psutil</span><span class="o">.</span><span class="n">process_iter</span><span class="p">():</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">proc</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s">&quot;gpg-agent&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">proc</span><span class="o">.</span><span class="n">is_running</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Found gpg-agent process with pid </span><span class="si">%d</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">proc</span><span class="o">.</span><span class="n">pid</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">proc</span><span class="o">.</span><span class="n">uids</span> <span class="o">==</span> <span class="n">identity</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span>
+ <span class="s">&quot;Effective UIDs of this process and gpg-agent match&quot;</span><span class="p">)</span>
+ <span class="nb">setattr</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="s">&#39;_agent_proc&#39;</span><span class="p">,</span> <span class="n">proc</span><span class="p">)</span>
+ <span class="k">return</span> <span class="bp">True</span>
+
+</div></div>
+<div class="viewcode-block" id="GPGBase"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase">[docs]</a><span class="k">class</span> <span class="nc">GPGBase</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Base class for storing properties and controlling process initialisation.</span>
+
+<span class="sd"> :const _result_map: A *dict* containing classes from</span>
+<span class="sd"> :mod:`~gnupg._parsers`, used for parsing results</span>
+<span class="sd"> obtained from GnuPG commands.</span>
+<span class="sd"> :const _decode_errors: How to handle encoding errors.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">__metaclass__</span> <span class="o">=</span> <span class="n">GPGMeta</span>
+ <span class="n">_decode_errors</span> <span class="o">=</span> <span class="s">&#39;strict&#39;</span>
+ <span class="n">_result_map</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&#39;crypt&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">Crypt</span><span class="p">,</span>
+ <span class="s">&#39;delete&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">DeleteResult</span><span class="p">,</span>
+ <span class="s">&#39;generate&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">GenKey</span><span class="p">,</span>
+ <span class="s">&#39;import&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">ImportResult</span><span class="p">,</span>
+ <span class="s">&#39;list&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">ListKeys</span><span class="p">,</span>
+ <span class="s">&#39;sign&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">Sign</span><span class="p">,</span>
+ <span class="s">&#39;verify&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">Verify</span><span class="p">,</span>
+ <span class="s">&#39;packets&#39;</span><span class="p">:</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">ListPackets</span> <span class="p">}</span>
+
+<div class="viewcode-block" id="GPGBase.__init__"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">binary</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">home</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">keyring</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">secring</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+ <span class="n">use_agent</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">default_preference_list</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+ <span class="n">verbose</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">options</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Create a ``GPGBase``.</span>
+
+<span class="sd"> This class is used to set up properties for controlling the behaviour</span>
+<span class="sd"> of configuring various options for GnuPG, such as setting GnuPG&#39;s</span>
+<span class="sd"> **homedir** , and the paths to its **binary** and **keyring** .</span>
+
+<span class="sd"> :const binary: (:obj:`str`) The full path to the GnuPG binary.</span>
+
+<span class="sd"> :ivar homedir: (:class:`~gnupg._util.InheritableProperty`) The full</span>
+<span class="sd"> path to the current setting for the GnuPG</span>
+<span class="sd"> ``--homedir``.</span>
+
+<span class="sd"> :ivar _generated_keys: (:class:`~gnupg._util.InheritableProperty`)</span>
+<span class="sd"> Controls setting the directory for storing any</span>
+<span class="sd"> keys which are generated with</span>
+<span class="sd"> :meth:`~gnupg.GPG.gen_key`.</span>
+
+<span class="sd"> :ivar str keyring: The filename in **homedir** to use as the keyring</span>
+<span class="sd"> file for public keys.</span>
+<span class="sd"> :ivar str secring: The filename in **homedir** to use as the keyring</span>
+<span class="sd"> file for secret keys.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">binary</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_find_binary</span><span class="p">(</span><span class="n">binary</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">homedir</span> <span class="o">=</span> <span class="n">home</span> <span class="k">if</span> <span class="n">home</span> <span class="k">else</span> <span class="n">_util</span><span class="o">.</span><span class="n">_conf</span>
+ <span class="n">pub</span> <span class="o">=</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">keyring</span><span class="p">)</span> <span class="k">if</span> <span class="n">keyring</span> <span class="k">else</span> <span class="s">&#39;pubring.gpg&#39;</span>
+ <span class="n">sec</span> <span class="o">=</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">secring</span><span class="p">)</span> <span class="k">if</span> <span class="n">secring</span> <span class="k">else</span> <span class="s">&#39;secring.gpg&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">keyring</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_homedir</span><span class="p">,</span> <span class="n">pub</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">secring</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_homedir</span><span class="p">,</span> <span class="n">sec</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="o">=</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">_sanitise</span><span class="p">(</span><span class="n">options</span><span class="p">)</span> <span class="k">if</span> <span class="n">options</span> <span class="k">else</span> <span class="bp">None</span>
+
+ <span class="k">if</span> <span class="n">default_preference_list</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_prefs</span> <span class="o">=</span> <span class="n">_check_preferences</span><span class="p">(</span><span class="n">default_preference_list</span><span class="p">,</span> <span class="s">&#39;all&#39;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_prefs</span> <span class="o">=</span> <span class="s">&#39;SHA512 SHA384 SHA256 AES256 CAMELLIA256 TWOFISH&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_prefs</span> <span class="o">+=</span> <span class="s">&#39; AES192 ZLIB ZIP Uncompressed&#39;</span>
+
+ <span class="n">encoding</span> <span class="o">=</span> <span class="n">locale</span><span class="o">.</span><span class="n">getpreferredencoding</span><span class="p">()</span>
+ <span class="k">if</span> <span class="n">encoding</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span> <span class="c"># This happens on Jython!</span>
+ <span class="n">encoding</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">encoding</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span> <span class="o">=</span> <span class="n">encoding</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="s">&#39;_&#39;</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_filesystemencoding</span> <span class="o">=</span> <span class="n">encodings</span><span class="o">.</span><span class="n">normalize_encoding</span><span class="p">(</span>
+ <span class="n">sys</span><span class="o">.</span><span class="n">getfilesystemencoding</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">())</span>
+
+ <span class="bp">self</span><span class="o">.</span><span class="n">_keyserver</span> <span class="o">=</span> <span class="s">&#39;hkp://wwwkeys.pgp.net&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">__generated_keys</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">homedir</span><span class="p">,</span> <span class="s">&#39;generated-keys&#39;</span><span class="p">)</span>
+
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">,</span> <span class="s">&quot;Could not find binary </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">binary</span>
+ <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">verbose</span><span class="p">,</span> <span class="p">(</span><span class="nb">bool</span><span class="p">,</span> <span class="nb">str</span><span class="p">,</span> <span class="nb">int</span><span class="p">)),</span> \
+ <span class="s">&quot;&#39;verbose&#39; must be boolean, string, or 0 &lt;= n &lt;= 9&quot;</span>
+ <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">use_agent</span><span class="p">,</span> <span class="nb">bool</span><span class="p">),</span> <span class="s">&quot;&#39;use_agent&#39; must be boolean&quot;</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">,</span> <span class="nb">str</span><span class="p">),</span> <span class="s">&quot;options not string&quot;</span>
+ <span class="k">except</span> <span class="p">(</span><span class="ne">AssertionError</span><span class="p">,</span> <span class="ne">AttributeError</span><span class="p">)</span> <span class="k">as</span> <span class="n">ae</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;GPGBase.__init__(): </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">verbose</span> <span class="ow">is</span> <span class="bp">True</span><span class="p">:</span>
+ <span class="c"># The caller wants logging, but we need a valid --debug-level</span>
+ <span class="c"># for gpg. Default to &quot;basic&quot;, and warn about the ambiguity.</span>
+ <span class="c"># (garrettr)</span>
+ <span class="n">verbose</span> <span class="o">=</span> <span class="s">&quot;basic&quot;</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warning</span><span class="p">(</span><span class="s">&#39;GPG(verbose=True) is ambiguous, defaulting to &quot;basic&quot; logging&#39;</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">verbose</span> <span class="o">=</span> <span class="n">verbose</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">use_agent</span> <span class="o">=</span> <span class="n">use_agent</span>
+
+ <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;_agent_proc&#39;</span><span class="p">)</span> \
+ <span class="ow">and</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;_remove_agent&#39;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">True</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s">&#39;__remove_path__&#39;</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">__remove_path__</span><span class="p">(</span><span class="s">&#39;pinentry&#39;</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="GPGBase.__remove_path__"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase.__remove_path__">[docs]</a> <span class="k">def</span> <span class="nf">__remove_path__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prog</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">at_exit</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Remove the directories containing a program from the system&#39;s</span>
+<span class="sd"> ``$PATH``. If ``GPGBase.binary`` is in a directory being removed, it</span>
+<span class="sd"> is linked to :file:&#39;./gpg&#39; in the current directory.</span>
+
+<span class="sd"> :param str prog: The program to remove from ``$PATH``.</span>
+<span class="sd"> :param bool at_exit: Add the program back into the ``$PATH`` when the</span>
+<span class="sd"> Python interpreter exits, and delete any symlinks</span>
+<span class="sd"> to ``GPGBase.binary`` which were created.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="c">#: A list of ``$PATH`` entries which were removed to disable pinentry.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_removed_path_entries</span> <span class="o">=</span> <span class="p">[]</span>
+
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Attempting to remove </span><span class="si">%s</span><span class="s"> from system PATH&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">prog</span><span class="p">))</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">prog</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">or</span> <span class="p">(</span><span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">prog</span><span class="p">,</span> <span class="nb">str</span><span class="p">)):</span> <span class="k">return</span>
+
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">program</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_which</span><span class="p">(</span><span class="n">prog</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="k">except</span> <span class="p">(</span><span class="ne">OSError</span><span class="p">,</span> <span class="ne">IOError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">)</span> <span class="k">as</span> <span class="n">err</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">err</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">err</span><span class="p">))</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">err</span><span class="p">(</span><span class="s">&quot;Cannot find program &#39;</span><span class="si">%s</span><span class="s">&#39;, not changing PATH.&quot;</span> <span class="o">%</span> <span class="n">prog</span><span class="p">)</span>
+ <span class="k">return</span>
+
+ <span class="c">## __remove_path__ cannot be an @classmethod in GPGMeta, because</span>
+ <span class="c">## the use_agent attribute must be set by the instance.</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">use_agent</span><span class="p">:</span>
+ <span class="n">program_base</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">prog</span><span class="p">)</span>
+ <span class="n">gnupg_base</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">)</span>
+
+ <span class="c">## symlink our gpg binary into $PWD if the path we are removing is</span>
+ <span class="c">## the one which contains our gpg executable:</span>
+ <span class="n">new_gpg_location</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">(),</span> <span class="s">&#39;gpg&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">gnupg_base</span> <span class="o">==</span> <span class="n">program_base</span><span class="p">:</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">symlink</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">,</span> <span class="n">new_gpg_location</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">binary</span> <span class="o">=</span> <span class="n">new_gpg_location</span>
+
+ <span class="c">## copy the original environment so that we can put it back later:</span>
+ <span class="n">env_copy</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span> <span class="c">## this one should not be touched</span>
+ <span class="n">path_copy</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s">&#39;PATH&#39;</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Created a copy of system PATH: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">path_copy</span><span class="p">)</span>
+ <span class="k">assert</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">has_key</span><span class="p">(</span><span class="s">&#39;PATH&#39;</span><span class="p">),</span> <span class="s">&quot;OS env kept $PATH anyway!&quot;</span>
+
+ <span class="nd">@staticmethod</span>
+ <span class="k">def</span> <span class="nf">remove_program_from_path</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">prog_base</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Remove all directories which contain a program from PATH.</span>
+
+<span class="sd"> :param str path: The contents of the system environment&#39;s</span>
+<span class="sd"> ``$PATH``.</span>
+
+<span class="sd"> :param str prog_base: The directory portion of a program&#39;s</span>
+<span class="sd"> location, without the trailing slash,</span>
+<span class="sd"> and without the program name. For</span>
+<span class="sd"> example, ``prog_base=&#39;/usr/bin&#39;``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">paths</span> <span class="o">=</span> <span class="n">path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;:&#39;</span><span class="p">)</span>
+ <span class="k">for</span> <span class="n">directory</span> <span class="ow">in</span> <span class="n">paths</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">directory</span> <span class="o">==</span> <span class="n">prog_base</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Found directory with target program: </span><span class="si">%s</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+ <span class="n">path</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_removed_path_entries</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Deleted all found instance of </span><span class="si">%s</span><span class="s">.&quot;</span> <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;PATH is now:</span><span class="si">%s%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">linesep</span><span class="p">,</span> <span class="n">path</span><span class="p">))</span>
+ <span class="n">new_path</span> <span class="o">=</span> <span class="s">&#39;:&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">p</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">path</span><span class="p">])</span>
+ <span class="k">return</span> <span class="n">new_path</span>
+
+ <span class="nd">@staticmethod</span>
+ <span class="k">def</span> <span class="nf">update_path</span><span class="p">(</span><span class="n">environment</span><span class="p">,</span> <span class="n">path</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Add paths to the string at ``os.environ[&#39;PATH&#39;]``.</span>
+
+<span class="sd"> :param str environment: The environment mapping to update.</span>
+<span class="sd"> :param list path: A list of strings to update the PATH with.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Updating system path...&quot;</span><span class="p">)</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">environ</span> <span class="o">=</span> <span class="n">environment</span>
+ <span class="n">new_path</span> <span class="o">=</span> <span class="s">&#39;:&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">p</span> <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">path</span><span class="p">])</span>
+ <span class="n">old</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+ <span class="k">if</span> <span class="s">&#39;PATH&#39;</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">:</span>
+ <span class="n">new_path</span> <span class="o">=</span> <span class="s">&#39;:&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&#39;PATH&#39;</span><span class="p">],</span> <span class="n">new_path</span><span class="p">])</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">update</span><span class="p">({</span><span class="s">&#39;PATH&#39;</span><span class="p">:</span> <span class="n">new_path</span><span class="p">})</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;System $PATH: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&#39;PATH&#39;</span><span class="p">])</span>
+
+ <span class="n">modified_path</span> <span class="o">=</span> <span class="n">remove_program_from_path</span><span class="p">(</span><span class="n">path_copy</span><span class="p">,</span> <span class="n">program_base</span><span class="p">)</span>
+ <span class="n">update_path</span><span class="p">(</span><span class="n">env_copy</span><span class="p">,</span> <span class="n">modified_path</span><span class="p">)</span>
+
+ <span class="c">## register an _exithandler with the python interpreter:</span>
+ <span class="n">atexit</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">update_path</span><span class="p">,</span> <span class="n">env_copy</span><span class="p">,</span> <span class="n">path_copy</span><span class="p">)</span>
+
+ <span class="k">def</span> <span class="nf">remove_symlinked_binary</span><span class="p">(</span><span class="n">symlink</span><span class="p">):</span>
+ <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">islink</span><span class="p">(</span><span class="n">symlink</span><span class="p">):</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">unlink</span><span class="p">(</span><span class="n">symlink</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Removed binary symlink &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">symlink</span><span class="p">)</span>
+ <span class="n">atexit</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">remove_symlinked_binary</span><span class="p">,</span> <span class="n">new_gpg_location</span><span class="p">)</span>
+</div>
+ <span class="nd">@property</span>
+ <span class="k">def</span> <span class="nf">default_preference_list</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Get the default preference list.&quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_prefs</span>
+
+ <span class="nd">@default_preference_list.setter</span>
+ <span class="k">def</span> <span class="nf">default_preference_list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">prefs</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Set the default preference list.</span>
+
+<span class="sd"> :param str prefs: A string containing the default preferences for</span>
+<span class="sd"> ciphers, digests, and compression algorithms.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">prefs</span> <span class="o">=</span> <span class="n">_check_preferences</span><span class="p">(</span><span class="n">prefs</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">prefs</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_prefs</span> <span class="o">=</span> <span class="n">prefs</span>
+
+ <span class="nd">@default_preference_list.deleter</span>
+<div class="viewcode-block" id="GPGBase.default_preference_list"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase.default_preference_list">[docs]</a> <span class="k">def</span> <span class="nf">default_preference_list</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Reset the default preference list to its original state.</span>
+
+<span class="sd"> Note that &quot;original state&quot; does not mean the default preference</span>
+<span class="sd"> list for whichever version of GnuPG is being used. It means the</span>
+<span class="sd"> default preference list defined by :attr:`GPGBase._prefs`.</span>
+
+<span class="sd"> Using BZIP2 is avoided due to not interacting well with some versions</span>
+<span class="sd"> of GnuPG&gt;=2.0.0.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_prefs</span> <span class="o">=</span> <span class="s">&#39;SHA512 SHA384 SHA256 AES256 CAMELLIA256 TWOFISH ZLIB ZIP&#39;</span>
+</div>
+ <span class="nd">@property</span>
+ <span class="k">def</span> <span class="nf">keyserver</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Get the current keyserver setting.&quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_keyserver</span>
+
+ <span class="nd">@keyserver.setter</span>
+ <span class="k">def</span> <span class="nf">keyserver</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">location</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Set the default keyserver to use for sending and receiving keys.</span>
+
+<span class="sd"> The ``location`` is sent to :func:`_parsers._check_keyserver` when</span>
+<span class="sd"> option are parsed in :meth:`gnupg.GPG._make_options`.</span>
+
+<span class="sd"> :param str location: A string containing the default keyserver. This</span>
+<span class="sd"> should contain the desired keyserver protocol</span>
+<span class="sd"> which is supported by the keyserver, for example,</span>
+<span class="sd"> ``&#39;hkps://keys.mayfirst.org&#39;``. The default</span>
+<span class="sd"> keyserver is ``&#39;hkp://wwwkeys.pgp.net&#39;``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_keyserver</span> <span class="o">=</span> <span class="n">location</span>
+
+ <span class="nd">@keyserver.deleter</span>
+<div class="viewcode-block" id="GPGBase.keyserver"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase.keyserver">[docs]</a> <span class="k">def</span> <span class="nf">keyserver</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Reset the keyserver to the default setting.&quot;&quot;&quot;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_keyserver</span> <span class="o">=</span> <span class="s">&#39;hkp://wwwkeys.pgp.net&#39;</span>
+</div>
+<div class="viewcode-block" id="GPGBase._homedir_getter"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._homedir_getter">[docs]</a> <span class="k">def</span> <span class="nf">_homedir_getter</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Get the directory currently being used as GnuPG&#39;s homedir.</span>
+
+<span class="sd"> If unspecified, use :file:`~/.config/python-gnupg/`</span>
+
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: The absolute path to the current GnuPG homedir.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_homedir</span>
+</div>
+<div class="viewcode-block" id="GPGBase._homedir_setter"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._homedir_setter">[docs]</a> <span class="k">def</span> <span class="nf">_homedir_setter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">directory</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Set the directory to use as GnuPG&#39;s homedir.</span>
+
+<span class="sd"> If unspecified, use $HOME/.config/python-gnupg. If specified, ensure</span>
+<span class="sd"> that the ``directory`` does not contain various shell escape</span>
+<span class="sd"> characters. If ``directory`` is not found, it will be automatically</span>
+<span class="sd"> created. Lastly, the ``direcory`` will be checked that the EUID has</span>
+<span class="sd"> read and write permissions for it.</span>
+
+<span class="sd"> :param str directory: A relative or absolute path to the directory to</span>
+<span class="sd"> use for storing/accessing GnuPG&#39;s files, including</span>
+<span class="sd"> keyrings and the trustdb.</span>
+<span class="sd"> :raises: :exc:`~exceptions.RuntimeError` if unable to find a suitable</span>
+<span class="sd"> directory to use.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">directory</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._homedir_setter(): Using default homedir: &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="n">_util</span><span class="o">.</span><span class="n">_conf</span><span class="p">)</span>
+ <span class="n">directory</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_conf</span>
+
+ <span class="n">hd</span> <span class="o">=</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._homedir_setter(): got directory &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">hd</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">hd</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._homedir_setter(): Check existence of &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">hd</span><span class="p">)</span>
+ <span class="n">_util</span><span class="o">.</span><span class="n">_create_if_necessary</span><span class="p">(</span><span class="n">hd</span><span class="p">)</span>
+
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._homedir_setter(): checking permissions&quot;</span><span class="p">)</span>
+ <span class="k">assert</span> <span class="n">_util</span><span class="o">.</span><span class="n">_has_readwrite</span><span class="p">(</span><span class="n">hd</span><span class="p">),</span> \
+ <span class="s">&quot;Homedir &#39;</span><span class="si">%s</span><span class="s">&#39; needs read/write permissions&quot;</span> <span class="o">%</span> <span class="n">hd</span>
+ <span class="k">except</span> <span class="ne">AssertionError</span> <span class="k">as</span> <span class="n">ae</span><span class="p">:</span>
+ <span class="n">msg</span> <span class="o">=</span> <span class="p">(</span><span class="s">&quot;Unable to set &#39;</span><span class="si">%s</span><span class="s">&#39; as GnuPG homedir&quot;</span> <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase.homedir.setter(): </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">msg</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Setting homedir to &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">hd</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_homedir</span> <span class="o">=</span> <span class="n">hd</span>
+</div>
+ <span class="n">homedir</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">InheritableProperty</span><span class="p">(</span><span class="n">_homedir_getter</span><span class="p">,</span> <span class="n">_homedir_setter</span><span class="p">)</span>
+
+<div class="viewcode-block" id="GPGBase._generated_keys_getter"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._generated_keys_getter">[docs]</a> <span class="k">def</span> <span class="nf">_generated_keys_getter</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Get the ``homedir`` subdirectory for storing generated keys.</span>
+
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: The absolute path to the current GnuPG homedir.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__generated_keys</span>
+</div>
+<div class="viewcode-block" id="GPGBase._generated_keys_setter"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._generated_keys_setter">[docs]</a> <span class="k">def</span> <span class="nf">_generated_keys_setter</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">directory</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Set the directory for storing generated keys.</span>
+
+<span class="sd"> If unspecified, use</span>
+<span class="sd"> :meth:`~gnupg._meta.GPGBase.homedir`/generated-keys. If specified,</span>
+<span class="sd"> ensure that the ``directory`` does not contain various shell escape</span>
+<span class="sd"> characters. If ``directory`` isn&#39;t found, it will be automatically</span>
+<span class="sd"> created. Lastly, the ``directory`` will be checked to ensure that the</span>
+<span class="sd"> current EUID has read and write permissions for it.</span>
+
+<span class="sd"> :param str directory: A relative or absolute path to the directory to</span>
+<span class="sd"> use for storing/accessing GnuPG&#39;s files, including keyrings and</span>
+<span class="sd"> the trustdb.</span>
+<span class="sd"> :raises: :exc:`~exceptions.RuntimeError` if unable to find a suitable</span>
+<span class="sd"> directory to use.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">directory</span><span class="p">:</span>
+ <span class="n">directory</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">homedir</span><span class="p">,</span> <span class="s">&#39;generated-keys&#39;</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._generated_keys_setter(): Using &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+
+ <span class="n">hd</span> <span class="o">=</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._generated_keys_setter(): got directory &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">hd</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">hd</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._generated_keys_setter(): Check exists &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="n">hd</span><span class="p">)</span>
+ <span class="n">_util</span><span class="o">.</span><span class="n">_create_if_necessary</span><span class="p">(</span><span class="n">hd</span><span class="p">)</span>
+
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._generated_keys_setter(): check permissions&quot;</span><span class="p">)</span>
+ <span class="k">assert</span> <span class="n">_util</span><span class="o">.</span><span class="n">_has_readwrite</span><span class="p">(</span><span class="n">hd</span><span class="p">),</span> \
+ <span class="s">&quot;Keys dir &#39;</span><span class="si">%s</span><span class="s">&#39; needs read/write permissions&quot;</span> <span class="o">%</span> <span class="n">hd</span>
+ <span class="k">except</span> <span class="ne">AssertionError</span> <span class="k">as</span> <span class="n">ae</span><span class="p">:</span>
+ <span class="n">msg</span> <span class="o">=</span> <span class="p">(</span><span class="s">&quot;Unable to set &#39;</span><span class="si">%s</span><span class="s">&#39; as generated keys dir&quot;</span> <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPGBase._generated_keys_setter(): </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">msg</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Setting homedir to &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">hd</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">__generated_keys</span> <span class="o">=</span> <span class="n">hd</span>
+</div>
+ <span class="n">_generated_keys</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">InheritableProperty</span><span class="p">(</span><span class="n">_generated_keys_getter</span><span class="p">,</span>
+ <span class="n">_generated_keys_setter</span><span class="p">)</span>
+
+<div class="viewcode-block" id="GPGBase._make_args"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._make_args">[docs]</a> <span class="k">def</span> <span class="nf">_make_args</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="n">passphrase</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Make a list of command line elements for GPG.</span>
+
+<span class="sd"> The value of ``args`` will be appended only if it passes the checks in</span>
+<span class="sd"> :func:`gnupg._parsers._sanitise`. The ``passphrase`` argument needs to</span>
+<span class="sd"> be True if a passphrase will be sent to GnuPG, else False.</span>
+
+<span class="sd"> :param list args: A list of strings of options and flags to pass to</span>
+<span class="sd"> ``GPG.binary``. This is input safe, meaning that</span>
+<span class="sd"> these values go through strict checks (see</span>
+<span class="sd"> ``parsers._sanitise_list``) before being passed to to</span>
+<span class="sd"> the input file descriptor for the GnuPG process.</span>
+<span class="sd"> Each string should be given exactly as it would be on</span>
+<span class="sd"> the commandline interface to GnuPG,</span>
+<span class="sd"> e.g. [&quot;--cipher-algo AES256&quot;, &quot;--default-key</span>
+<span class="sd"> A3ADB67A2CDB8B35&quot;].</span>
+
+<span class="sd"> :param bool passphrase: If True, the passphrase will be sent to the</span>
+<span class="sd"> stdin file descriptor for the attached GnuPG</span>
+<span class="sd"> process.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="c">## see TODO file, tag :io:makeargs:</span>
+ <span class="n">cmd</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">binary</span><span class="p">,</span>
+ <span class="s">&#39;--no-options --no-emit-version --no-tty --status-fd 2&#39;</span><span class="p">]</span>
+
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">homedir</span><span class="p">:</span> <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--homedir &quot;</span><span class="si">%s</span><span class="s">&quot;&#39;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">homedir</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">keyring</span><span class="p">:</span>
+ <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--no-default-keyring --keyring </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">keyring</span><span class="p">)</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">secring</span><span class="p">:</span>
+ <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--secret-keyring </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">secring</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">passphrase</span><span class="p">:</span> <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--batch --passphrase-fd 0&#39;</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">use_agent</span><span class="p">:</span> <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--use-agent&#39;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span> <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--no-use-agent&#39;</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">:</span>
+ <span class="p">[</span><span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">opt</span><span class="p">)</span> <span class="k">for</span> <span class="n">opt</span> <span class="ow">in</span> <span class="nb">iter</span><span class="p">(</span><span class="n">_sanitise_list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="p">))]</span>
+ <span class="k">if</span> <span class="n">args</span><span class="p">:</span>
+ <span class="p">[</span><span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span> <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="nb">iter</span><span class="p">(</span><span class="n">_sanitise_list</span><span class="p">(</span><span class="n">args</span><span class="p">))]</span>
+
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">verbose</span><span class="p">:</span>
+ <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--debug-all&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="p">((</span><span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">verbose</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span> <span class="ow">and</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">verbose</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;basic&#39;</span><span class="p">,</span> <span class="s">&#39;advanced&#39;</span><span class="p">,</span> <span class="s">&#39;expert&#39;</span><span class="p">,</span> <span class="s">&#39;guru&#39;</span><span class="p">])</span>
+ <span class="ow">or</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">verbose</span><span class="p">,</span> <span class="nb">int</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="mi">1</span><span class="o">&lt;=</span><span class="bp">self</span><span class="o">.</span><span class="n">verbose</span><span class="o">&lt;=</span><span class="mi">9</span><span class="p">))):</span>
+ <span class="n">cmd</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--debug-level </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">verbose</span><span class="p">)</span>
+
+ <span class="k">return</span> <span class="n">cmd</span>
+</div>
+<div class="viewcode-block" id="GPGBase._open_subprocess"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._open_subprocess">[docs]</a> <span class="k">def</span> <span class="nf">_open_subprocess</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">passphrase</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Open a pipe to a GPG subprocess and return the file objects for</span>
+<span class="sd"> communicating with it.</span>
+
+<span class="sd"> :param list args: A list of strings of options and flags to pass to</span>
+<span class="sd"> ``GPG.binary``. This is input safe, meaning that</span>
+<span class="sd"> these values go through strict checks (see</span>
+<span class="sd"> ``parsers._sanitise_list``) before being passed to to</span>
+<span class="sd"> the input file descriptor for the GnuPG process.</span>
+<span class="sd"> Each string should be given exactly as it would be on</span>
+<span class="sd"> the commandline interface to GnuPG,</span>
+<span class="sd"> e.g. [&quot;--cipher-algo AES256&quot;, &quot;--default-key</span>
+<span class="sd"> A3ADB67A2CDB8B35&quot;].</span>
+
+<span class="sd"> :param bool passphrase: If True, the passphrase will be sent to the</span>
+<span class="sd"> stdin file descriptor for the attached GnuPG</span>
+<span class="sd"> process.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="c">## see http://docs.python.org/2/library/subprocess.html#converting-an\</span>
+ <span class="c">## -argument-sequence-to-a-string-on-windows</span>
+ <span class="n">cmd</span> <span class="o">=</span> <span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_make_args</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">passphrase</span><span class="p">)))</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Sending command to GnuPG process:</span><span class="si">%s%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">linesep</span><span class="p">,</span> <span class="n">cmd</span><span class="p">))</span>
+
+ <span class="k">if</span> <span class="n">platform</span><span class="o">.</span><span class="n">system</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;Windows&quot;</span><span class="p">:</span>
+ <span class="c"># TODO figure out what the hell is going on there.</span>
+ <span class="n">expand_shell</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">expand_shell</span> <span class="o">=</span> <span class="bp">False</span>
+
+ <span class="k">return</span> <span class="n">subprocess</span><span class="o">.</span><span class="n">Popen</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="n">shell</span><span class="o">=</span><span class="n">expand_shell</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span>
+ <span class="n">stdout</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span> <span class="n">stderr</span><span class="o">=</span><span class="n">subprocess</span><span class="o">.</span><span class="n">PIPE</span><span class="p">,</span>
+ <span class="n">env</span><span class="o">=</span><span class="p">{</span><span class="s">&#39;LANGUAGE&#39;</span><span class="p">:</span> <span class="s">&#39;en&#39;</span><span class="p">})</span>
+</div>
+<div class="viewcode-block" id="GPGBase._read_response"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._read_response">[docs]</a> <span class="k">def</span> <span class="nf">_read_response</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stream</span><span class="p">,</span> <span class="n">result</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Reads all the stderr output from GPG, taking notice only of lines</span>
+<span class="sd"> that begin with the magic [GNUPG:] prefix.</span>
+
+<span class="sd"> Calls methods on the response object for each valid token found, with</span>
+<span class="sd"> the arg being the remainder of the status line.</span>
+
+<span class="sd"> :param stream: A byte-stream, file handle, or a</span>
+<span class="sd"> :data:`subprocess.PIPE` for parsing the status codes</span>
+<span class="sd"> from the GnuPG process.</span>
+
+<span class="sd"> :param result: The result parser class from :mod:`~gnupg._parsers` ―</span>
+<span class="sd"> the ``handle_status()`` method of that class will be</span>
+<span class="sd"> called in order to parse the output of ``stream``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">lines</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
+ <span class="n">line</span> <span class="o">=</span> <span class="n">stream</span><span class="o">.</span><span class="n">readline</span><span class="p">()</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="k">break</span>
+ <span class="n">lines</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
+ <span class="n">line</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">rstrip</span><span class="p">()</span>
+
+ <span class="k">if</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;[GNUPG:]&#39;</span><span class="p">):</span>
+ <span class="n">line</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_deprefix</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="s">&#39;[GNUPG:] &#39;</span><span class="p">,</span> <span class="n">log</span><span class="o">.</span><span class="n">status</span><span class="p">)</span>
+ <span class="n">keyword</span><span class="p">,</span> <span class="n">value</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_separate_keyword</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
+ <span class="n">result</span><span class="o">.</span><span class="n">_handle_status</span><span class="p">(</span><span class="n">keyword</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">line</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;gpg:&#39;</span><span class="p">):</span>
+ <span class="n">line</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_deprefix</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="s">&#39;gpg: &#39;</span><span class="p">)</span>
+ <span class="n">keyword</span><span class="p">,</span> <span class="n">value</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_separate_keyword</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
+
+ <span class="c"># Log gpg&#39;s userland messages at our own levels:</span>
+ <span class="k">if</span> <span class="n">keyword</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;WARNING&quot;</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">value</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">keyword</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&quot;FATAL&quot;</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">critical</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">value</span><span class="p">)</span>
+ <span class="c"># Handle the gpg2 error where a missing trustdb.gpg is,</span>
+ <span class="c"># for some stupid reason, considered fatal:</span>
+ <span class="k">if</span> <span class="n">value</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&quot;trustdb.gpg&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">value</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&quot;No such file&quot;</span><span class="p">):</span>
+ <span class="n">result</span><span class="o">.</span><span class="n">_handle_status</span><span class="p">(</span><span class="s">&#39;NEED_TRUSTDB&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">verbose</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">line</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">line</span><span class="p">)</span>
+ <span class="n">result</span><span class="o">.</span><span class="n">stderr</span> <span class="o">=</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">lines</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="GPGBase._read_data"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._read_data">[docs]</a> <span class="k">def</span> <span class="nf">_read_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stream</span><span class="p">,</span> <span class="n">result</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Incrementally read from ``stream`` and store read data.</span>
+
+<span class="sd"> All data gathered from calling ``stream.read()`` will be concatenated</span>
+<span class="sd"> and stored as ``result.data``.</span>
+
+<span class="sd"> :param stream: An open file-like object to read() from.</span>
+<span class="sd"> :param result: An instance of one of the :ref:`result parsing classes</span>
+<span class="sd"> &lt;parsers&gt;` from :const:`~gnupg._meta.GPGBase._result_map`.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">chunks</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Reading data from stream </span><span class="si">%r</span><span class="s">...&quot;</span> <span class="o">%</span> <span class="n">stream</span><span class="o">.</span><span class="n">__repr__</span><span class="p">())</span>
+
+ <span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
+ <span class="n">data</span> <span class="o">=</span> <span class="n">stream</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1024</span><span class="p">)</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="k">break</span>
+ <span class="n">chunks</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Read </span><span class="si">%4d</span><span class="s"> bytes&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
+
+ <span class="c"># Join using b&#39;&#39; or &#39;&#39;, as appropriate</span>
+ <span class="n">result</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">data</span><span class="p">)()</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">chunks</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Finishing reading from stream </span><span class="si">%r</span><span class="s">...&quot;</span> <span class="o">%</span> <span class="n">stream</span><span class="o">.</span><span class="n">__repr__</span><span class="p">())</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Read </span><span class="si">%4d</span><span class="s"> bytes total&quot;</span> <span class="o">%</span> <span class="nb">len</span><span class="p">(</span><span class="n">result</span><span class="o">.</span><span class="n">data</span><span class="p">))</span>
+</div>
+<div class="viewcode-block" id="GPGBase._collect_output"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._collect_output">[docs]</a> <span class="k">def</span> <span class="nf">_collect_output</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">process</span><span class="p">,</span> <span class="n">result</span><span class="p">,</span> <span class="n">writer</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">stdin</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Drain the subprocesses output streams, writing the collected output</span>
+<span class="sd"> to the result. If a writer thread (writing to the subprocess) is given,</span>
+<span class="sd"> make sure it&#39;s joined before returning. If a stdin stream is given,</span>
+<span class="sd"> close it before returning.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">stderr</span> <span class="o">=</span> <span class="n">codecs</span><span class="o">.</span><span class="n">getreader</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span><span class="p">)(</span><span class="n">process</span><span class="o">.</span><span class="n">stderr</span><span class="p">)</span>
+ <span class="n">rr</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_read_response</span><span class="p">,</span>
+ <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="n">result</span><span class="p">))</span>
+ <span class="n">rr</span><span class="o">.</span><span class="n">setDaemon</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;stderr reader: </span><span class="si">%r</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">rr</span><span class="p">)</span>
+ <span class="n">rr</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
+
+ <span class="n">stdout</span> <span class="o">=</span> <span class="n">process</span><span class="o">.</span><span class="n">stdout</span>
+ <span class="n">dr</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">_read_data</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">stdout</span><span class="p">,</span> <span class="n">result</span><span class="p">))</span>
+ <span class="n">dr</span><span class="o">.</span><span class="n">setDaemon</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;stdout reader: </span><span class="si">%r</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">dr</span><span class="p">)</span>
+ <span class="n">dr</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
+
+ <span class="n">dr</span><span class="o">.</span><span class="n">join</span><span class="p">()</span>
+ <span class="n">rr</span><span class="o">.</span><span class="n">join</span><span class="p">()</span>
+ <span class="k">if</span> <span class="n">writer</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="n">writer</span><span class="o">.</span><span class="n">join</span><span class="p">()</span>
+ <span class="n">process</span><span class="o">.</span><span class="n">wait</span><span class="p">()</span>
+ <span class="k">if</span> <span class="n">stdin</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">stdin</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
+ <span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
+ <span class="k">pass</span>
+ <span class="n">stderr</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
+ <span class="n">stdout</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
+</div>
+<div class="viewcode-block" id="GPGBase._handle_io"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._handle_io">[docs]</a> <span class="k">def</span> <span class="nf">_handle_io</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">,</span> <span class="nb">file</span><span class="p">,</span> <span class="n">result</span><span class="p">,</span> <span class="n">passphrase</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">binary</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Handle a call to GPG - pass input data, collect output data.&quot;&quot;&quot;</span>
+ <span class="n">p</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_open_subprocess</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">passphrase</span><span class="p">)</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">binary</span><span class="p">:</span>
+ <span class="n">stdin</span> <span class="o">=</span> <span class="n">codecs</span><span class="o">.</span><span class="n">getwriter</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span><span class="p">)(</span><span class="n">p</span><span class="o">.</span><span class="n">stdin</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">stdin</span> <span class="o">=</span> <span class="n">p</span><span class="o">.</span><span class="n">stdin</span>
+ <span class="k">if</span> <span class="n">passphrase</span><span class="p">:</span>
+ <span class="n">_util</span><span class="o">.</span><span class="n">_write_passphrase</span><span class="p">(</span><span class="n">stdin</span><span class="p">,</span> <span class="n">passphrase</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span><span class="p">)</span>
+ <span class="n">writer</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_threaded_copy_data</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">stdin</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_collect_output</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">result</span><span class="p">,</span> <span class="n">writer</span><span class="p">,</span> <span class="n">stdin</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">result</span>
+</div>
+<div class="viewcode-block" id="GPGBase._recv_keys"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._recv_keys">[docs]</a> <span class="k">def</span> <span class="nf">_recv_keys</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">keyids</span><span class="p">,</span> <span class="n">keyserver</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Import keys from a keyserver.</span>
+
+<span class="sd"> :param str keyids: A space-delimited string containing the keyids to</span>
+<span class="sd"> request.</span>
+<span class="sd"> :param str keyserver: The keyserver to request the ``keyids`` from;</span>
+<span class="sd"> defaults to `gnupg.GPG.keyserver`.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">keyserver</span><span class="p">:</span>
+ <span class="n">keyserver</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">keyserver</span>
+
+ <span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;--keyserver {0}&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">keyserver</span><span class="p">),</span>
+ <span class="s">&#39;--recv-keys {0}&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">keyids</span><span class="p">)]</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;Requesting keys from </span><span class="si">%s</span><span class="s">: </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="p">(</span><span class="n">keyserver</span><span class="p">,</span> <span class="n">keyids</span><span class="p">))</span>
+
+ <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_result_map</span><span class="p">[</span><span class="s">&#39;import&#39;</span><span class="p">](</span><span class="bp">self</span><span class="p">)</span>
+ <span class="n">proc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_open_subprocess</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_collect_output</span><span class="p">(</span><span class="n">proc</span><span class="p">,</span> <span class="n">result</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;recv_keys result: </span><span class="si">%r</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">result</span><span class="o">.</span><span class="n">__dict__</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">result</span>
+</div>
+<div class="viewcode-block" id="GPGBase._sign_file"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._sign_file">[docs]</a> <span class="k">def</span> <span class="nf">_sign_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">file</span><span class="p">,</span> <span class="n">default_key</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">passphrase</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+ <span class="n">clearsign</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span> <span class="n">detach</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">binary</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
+ <span class="n">digest_algo</span><span class="o">=</span><span class="s">&#39;SHA512&#39;</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Create a signature for a file.</span>
+
+<span class="sd"> :param file: The file stream (i.e. it&#39;s already been open()&#39;d) to sign.</span>
+<span class="sd"> :param str default_key: The key to sign with.</span>
+<span class="sd"> :param str passphrase: The passphrase to pipe to stdin.</span>
+<span class="sd"> :param bool clearsign: If True, create a cleartext signature.</span>
+<span class="sd"> :param bool detach: If True, create a detached signature.</span>
+<span class="sd"> :param bool binary: If True, do not ascii armour the output.</span>
+<span class="sd"> :param str digest_algo: The hash digest to use. Again, to see which</span>
+<span class="sd"> hashes your GnuPG is capable of using, do:</span>
+<span class="sd"> ``$ gpg --with-colons --list-config</span>
+<span class="sd"> digestname``. The default, if unspecified, is</span>
+<span class="sd"> ``&#39;SHA512&#39;``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;_sign_file():&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">binary</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Creating binary signature for file </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">file</span><span class="p">)</span>
+ <span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;--sign&#39;</span><span class="p">]</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Creating ascii-armoured signature for file </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">file</span><span class="p">)</span>
+ <span class="n">args</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;--sign --armor&#39;</span><span class="p">]</span>
+
+ <span class="k">if</span> <span class="n">clearsign</span><span class="p">:</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&quot;--clearsign&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">detach</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;Cannot use both --clearsign and --detach-sign.&quot;</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;Using default GPG behaviour: --clearsign only.&quot;</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">detach</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">clearsign</span><span class="p">:</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&quot;--detach-sign&quot;</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">default_key</span><span class="p">:</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="s">&quot;--default-key </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">default_key</span><span class="p">))</span>
+
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="s">&quot;--digest-algo </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">digest_algo</span><span class="p">))</span>
+
+ <span class="c">## We could use _handle_io here except for the fact that if the</span>
+ <span class="c">## passphrase is bad, gpg bails and you can&#39;t write the message.</span>
+ <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_result_map</span><span class="p">[</span><span class="s">&#39;sign&#39;</span><span class="p">](</span><span class="bp">self</span><span class="p">)</span>
+ <span class="n">proc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_open_subprocess</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">passphrase</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">)</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">passphrase</span><span class="p">:</span>
+ <span class="n">_util</span><span class="o">.</span><span class="n">_write_passphrase</span><span class="p">(</span><span class="n">proc</span><span class="o">.</span><span class="n">stdin</span><span class="p">,</span> <span class="n">passphrase</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_encoding</span><span class="p">)</span>
+ <span class="n">writer</span> <span class="o">=</span> <span class="n">_util</span><span class="o">.</span><span class="n">_threaded_copy_data</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">proc</span><span class="o">.</span><span class="n">stdin</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">IOError</span> <span class="k">as</span> <span class="n">ioe</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="s">&quot;Error writing message: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">ioe</span><span class="p">))</span>
+ <span class="n">writer</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_collect_output</span><span class="p">(</span><span class="n">proc</span><span class="p">,</span> <span class="n">result</span><span class="p">,</span> <span class="n">writer</span><span class="p">,</span> <span class="n">proc</span><span class="o">.</span><span class="n">stdin</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">result</span>
+</div>
+<div class="viewcode-block" id="GPGBase._encrypt"><a class="viewcode-back" href="../../gnupg.html#gnupg._meta.GPGBase._encrypt">[docs]</a> <span class="k">def</span> <span class="nf">_encrypt</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">recipients</span><span class="p">,</span>
+ <span class="n">default_key</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+ <span class="n">passphrase</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+ <span class="n">armor</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
+ <span class="n">encrypt</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
+ <span class="n">symmetric</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span>
+ <span class="n">always_trust</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
+ <span class="n">output</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
+ <span class="n">cipher_algo</span><span class="o">=</span><span class="s">&#39;AES256&#39;</span><span class="p">,</span>
+ <span class="n">digest_algo</span><span class="o">=</span><span class="s">&#39;SHA512&#39;</span><span class="p">,</span>
+ <span class="n">compress_algo</span><span class="o">=</span><span class="s">&#39;ZLIB&#39;</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Encrypt the message read from the file-like object **data**.</span>
+
+<span class="sd"> :param str data: The file or bytestream to encrypt.</span>
+
+<span class="sd"> :param str recipients: The recipients to encrypt to. Recipients must</span>
+<span class="sd"> be specified keyID/fingerprint.</span>
+
+<span class="sd"> .. warning:: Care should be taken in Python2 to make sure that the</span>
+<span class="sd"> given fingerprints for **recipients** are in fact strings</span>
+<span class="sd"> and not unicode objects.</span>
+
+<span class="sd"> :param str default_key: The keyID/fingerprint of the key to use for</span>
+<span class="sd"> signing. If given, **data** will be encrypted</span>
+<span class="sd"> *and* signed.</span>
+
+<span class="sd"> :param str passphrase: If given, and **default_key** is also given,</span>
+<span class="sd"> use this passphrase to unlock the secret</span>
+<span class="sd"> portion of the **default_key** to sign the</span>
+<span class="sd"> encrypted **data**. Otherwise, if</span>
+<span class="sd"> **default_key** is not given, but **symmetric**</span>
+<span class="sd"> is ``True``, then use this passphrase as the</span>
+<span class="sd"> passphrase for symmetric encryption. Signing</span>
+<span class="sd"> and symmetric encryption should *not* be</span>
+<span class="sd"> combined when sending the **data** to other</span>
+<span class="sd"> recipients, else the passphrase to the secret</span>
+<span class="sd"> key would be shared with them.</span>
+
+<span class="sd"> :param bool armor: If True, ascii armor the output; otherwise, the</span>
+<span class="sd"> output will be in binary format. (Default: True)</span>
+
+<span class="sd"> :param bool encrypt: If True, encrypt the **data** using the</span>
+<span class="sd"> **recipients** public keys. (Default: True)</span>
+
+<span class="sd"> :param bool symmetric: If True, encrypt the **data** to **recipients**</span>
+<span class="sd"> using a symmetric key. See the **passphrase**</span>
+<span class="sd"> parameter. Symmetric encryption and public key</span>
+<span class="sd"> encryption can be used simultaneously, and will</span>
+<span class="sd"> result in a ciphertext which is decryptable</span>
+<span class="sd"> with either the symmetric **passphrase** or one</span>
+<span class="sd"> of the corresponding private keys.</span>
+
+<span class="sd"> :param bool always_trust: If True, ignore trust warnings on</span>
+<span class="sd"> **recipients** keys. If False, display trust</span>
+<span class="sd"> warnings. (default: True)</span>
+
+<span class="sd"> :param str output: The output file to write to. If not specified, the</span>
+<span class="sd"> encrypted output is returned, and thus should be</span>
+<span class="sd"> stored as an object in Python. For example:</span>
+
+
+<span class="sd"> &gt;&gt;&gt; import shutil</span>
+<span class="sd"> &gt;&gt;&gt; import gnupg</span>
+<span class="sd"> &gt;&gt;&gt; if os.path.exists(&quot;doctests&quot;):</span>
+<span class="sd"> ... shutil.rmtree(&quot;doctests&quot;)</span>
+<span class="sd"> &gt;&gt;&gt; gpg = gnupg.GPG(homedir=&quot;doctests&quot;)</span>
+<span class="sd"> &gt;&gt;&gt; key_settings = gpg.gen_key_input(key_type=&#39;RSA&#39;,</span>
+<span class="sd"> ... key_length=1024,</span>
+<span class="sd"> ... key_usage=&#39;ESCA&#39;,</span>
+<span class="sd"> ... passphrase=&#39;foo&#39;)</span>
+<span class="sd"> &gt;&gt;&gt; key = gpg.gen_key(key_settings)</span>
+<span class="sd"> &gt;&gt;&gt; message = &quot;The crow flies at midnight.&quot;</span>
+<span class="sd"> &gt;&gt;&gt; encrypted = str(gpg.encrypt(message, key.printprint))</span>
+<span class="sd"> &gt;&gt;&gt; assert encrypted != message</span>
+<span class="sd"> &gt;&gt;&gt; assert not encrypted.isspace()</span>
+<span class="sd"> &gt;&gt;&gt; decrypted = str(gpg.decrypt(encrypted))</span>
+<span class="sd"> &gt;&gt;&gt; assert not decrypted.isspace()</span>
+<span class="sd"> &gt;&gt;&gt; decrypted</span>
+<span class="sd"> &#39;The crow flies at midnight.&#39;</span>
+
+<span class="sd"> :param str cipher_algo: The cipher algorithm to use. To see available</span>
+<span class="sd"> algorithms with your version of GnuPG, do:</span>
+<span class="sd"> :command:`$ gpg --with-colons --list-config</span>
+<span class="sd"> ciphername`. The default **cipher_algo**, if</span>
+<span class="sd"> unspecified, is ``&#39;AES256&#39;``.</span>
+
+<span class="sd"> :param str digest_algo: The hash digest to use. Again, to see which</span>
+<span class="sd"> hashes your GnuPG is capable of using, do:</span>
+<span class="sd"> :command:`$ gpg --with-colons --list-config</span>
+<span class="sd"> digestname`. The default, if unspecified, is</span>
+<span class="sd"> ``&#39;SHA512&#39;``.</span>
+
+<span class="sd"> :param str compress_algo: The compression algorithm to use. Can be one</span>
+<span class="sd"> of ``&#39;ZLIB&#39;``, ``&#39;BZIP2&#39;``, ``&#39;ZIP&#39;``, or</span>
+<span class="sd"> ``&#39;Uncompressed&#39;``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">args</span> <span class="o">=</span> <span class="p">[]</span>
+
+ <span class="k">if</span> <span class="n">output</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">output</span><span class="p">,</span> <span class="s">&#39;fileno&#39;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="c">## avoid overwrite confirmation message</span>
+ <span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">output</span><span class="p">,</span> <span class="s">&#39;name&#39;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">output</span><span class="p">):</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">output</span><span class="p">)</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--output </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">output</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="n">output</span><span class="o">.</span><span class="n">name</span><span class="p">):</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">output</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--output </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">output</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">armor</span><span class="p">:</span> <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--armor&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">always_trust</span><span class="p">:</span> <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--always-trust&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">cipher_algo</span><span class="p">:</span> <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--cipher-algo </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">cipher_algo</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">compress_algo</span><span class="p">:</span> <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--compress-algo </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">compress_algo</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">default_key</span><span class="p">:</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--sign&#39;</span><span class="p">)</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--default-key </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">default_key</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">digest_algo</span><span class="p">:</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--digest-algo </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">digest_algo</span><span class="p">)</span>
+
+ <span class="c">## both can be used at the same time for an encrypted file which</span>
+ <span class="c">## is decryptable with a passphrase or secretkey.</span>
+ <span class="k">if</span> <span class="n">symmetric</span><span class="p">:</span> <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--symmetric&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">encrypt</span><span class="p">:</span> <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--encrypt&#39;</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">recipients</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">1</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;GPG.encrypt() called for recipients &#39;</span><span class="si">%s</span><span class="s">&#39; with type &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="p">(</span><span class="n">recipients</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">recipients</span><span class="p">)))</span>
+
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">recipients</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">)):</span>
+ <span class="k">for</span> <span class="n">recp</span> <span class="ow">in</span> <span class="n">recipients</span><span class="p">:</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">recp</span><span class="p">,</span> <span class="nb">unicode</span><span class="p">):</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="n">_parsers</span><span class="o">.</span><span class="n">_is_hex</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">recp</span><span class="p">))</span>
+ <span class="k">except</span> <span class="ne">AssertionError</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Can&#39;t accept recipient string: </span><span class="si">%s</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="n">recp</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--recipient </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">recp</span><span class="p">))</span>
+ <span class="k">continue</span>
+ <span class="c">## will give unicode in 2.x as &#39;\uXXXX\uXXXX&#39;</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--recipient </span><span class="si">%r</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">recp</span><span class="p">)</span>
+ <span class="k">continue</span>
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">recp</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--recipient </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">recp</span><span class="p">)</span>
+
+ <span class="k">elif</span> <span class="p">(</span><span class="ow">not</span> <span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">recp</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">):</span>
+ <span class="k">for</span> <span class="n">recp</span> <span class="ow">in</span> <span class="n">recipients</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;</span><span class="se">\x20</span><span class="s">&#39;</span><span class="p">):</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--recipient </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">recp</span><span class="p">)</span>
+
+ <span class="k">elif</span> <span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">recp</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
+ <span class="k">for</span> <span class="n">recp</span> <span class="ow">in</span> <span class="n">recipients</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">):</span>
+ <span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--recipient </span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">recp</span><span class="p">)</span>
+ <span class="c">## ...and now that we&#39;ve proven py3k is better...</span>
+
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Don&#39;t know what to do with recipients: &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="n">recipients</span><span class="p">)</span>
+
+ <span class="n">result</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_result_map</span><span class="p">[</span><span class="s">&#39;crypt&#39;</span><span class="p">](</span><span class="bp">self</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got data &#39;</span><span class="si">%s</span><span class="s">&#39; with type &#39;</span><span class="si">%s</span><span class="s">&#39;.&quot;</span>
+ <span class="o">%</span> <span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">data</span><span class="p">)))</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_handle_io</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">result</span><span class="p">,</span>
+ <span class="n">passphrase</span><span class="o">=</span><span class="n">passphrase</span><span class="p">,</span> <span class="n">binary</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;</span><span class="se">\n</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">result</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">result</span></div></div>
+</pre></div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="../../search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="../../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../../genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/_modules/gnupg/_parsers.html b/docs/_build/html/_modules/gnupg/_parsers.html
new file mode 100644
index 0000000..a203f11
--- /dev/null
+++ b/docs/_build/html/_modules/gnupg/_parsers.html
@@ -0,0 +1,1486 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>gnupg._parsers &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="../../_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '../../',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="../../index.html" />
+ <link rel="up" title="gnupg" href="../gnupg.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="../../index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="../../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../../genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>Source code for gnupg._parsers</h1><div class="highlight"><pre>
+<span class="c"># -*- coding: utf-8 -*-</span>
+<span class="c">#</span>
+<span class="c"># This file is part of python-gnupg, a Python interface to GnuPG.</span>
+<span class="c"># Copyright © 2013 Isis Lovecruft, &lt;isis@leap.se&gt; 0xA3ADB67A2CDB8B35</span>
+<span class="c"># © 2013 Andrej B.</span>
+<span class="c"># © 2013 LEAP Encryption Access Project</span>
+<span class="c"># © 2008-2012 Vinay Sajip</span>
+<span class="c"># © 2005 Steve Traugott</span>
+<span class="c"># © 2004 A.M. Kuchling</span>
+<span class="c">#</span>
+<span class="c"># This program is free software: you can redistribute it and/or modify it</span>
+<span class="c"># under the terms of the GNU General Public License as published by the Free</span>
+<span class="c"># Software Foundation, either version 3 of the License, or (at your option)</span>
+<span class="c"># any later version.</span>
+<span class="c">#</span>
+<span class="c"># This program is distributed in the hope that it will be useful, but WITHOUT</span>
+<span class="c"># ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
+<span class="c"># FITNESS FOR A PARTICULAR PURPOSE. See the included LICENSE file for details.</span>
+
+<span class="sd">&#39;&#39;&#39;Classes for parsing GnuPG status messages and sanitising commandline</span>
+<span class="sd">options.</span>
+<span class="sd">&#39;&#39;&#39;</span>
+
+<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">absolute_import</span>
+<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">print_function</span>
+
+<span class="k">try</span><span class="p">:</span>
+ <span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">OrderedDict</span>
+<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
+ <span class="kn">from</span> <span class="nn">ordereddict</span> <span class="kn">import</span> <span class="n">OrderedDict</span>
+
+<span class="kn">import</span> <span class="nn">re</span>
+
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_util</span>
+<span class="kn">from</span> <span class="nn">._util</span> <span class="kn">import</span> <span class="n">log</span>
+
+
+<span class="n">ESCAPE_PATTERN</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">r&#39;</span><span class="se">\\</span><span class="s">x([0-9a-f][0-9a-f])&#39;</span><span class="p">,</span> <span class="n">re</span><span class="o">.</span><span class="n">I</span><span class="p">)</span>
+<span class="n">HEXIDECIMAL</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">&#39;([0-9A-Fa-f]{2})+&#39;</span><span class="p">)</span>
+
+
+<div class="viewcode-block" id="ProtectedOption"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ProtectedOption">[docs]</a><span class="k">class</span> <span class="nc">ProtectedOption</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Raised when the option passed to GPG is disallowed.&quot;&quot;&quot;</span>
+</div>
+<div class="viewcode-block" id="UsageError"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.UsageError">[docs]</a><span class="k">class</span> <span class="nc">UsageError</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Raised when incorrect usage of the API occurs..&quot;&quot;&quot;</span>
+
+</div>
+<div class="viewcode-block" id="_check_keyserver"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._check_keyserver">[docs]</a><span class="k">def</span> <span class="nf">_check_keyserver</span><span class="p">(</span><span class="n">location</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that a given keyserver is a known protocol and does not contain</span>
+<span class="sd"> shell escape characters.</span>
+
+<span class="sd"> :param str location: A string containing the default keyserver. This</span>
+<span class="sd"> should contain the desired keyserver protocol which</span>
+<span class="sd"> is supported by the keyserver, for example, the</span>
+<span class="sd"> default is ``&#39;hkp://wwwkeys .pgp.net&#39;``.</span>
+<span class="sd"> :rtype: :obj:`str` or :obj:`None`</span>
+<span class="sd"> :returns: A string specifying the protocol and keyserver hostname, if the</span>
+<span class="sd"> checks passed. If not, returns None.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">protocols</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;hkp://&#39;</span><span class="p">,</span> <span class="s">&#39;hkps://&#39;</span><span class="p">,</span> <span class="s">&#39;http://&#39;</span><span class="p">,</span> <span class="s">&#39;https://&#39;</span><span class="p">,</span> <span class="s">&#39;ldap://&#39;</span><span class="p">,</span>
+ <span class="s">&#39;mailto:&#39;</span><span class="p">]</span> <span class="c">## xxx feels like i´m forgetting one...</span>
+ <span class="k">for</span> <span class="n">proto</span> <span class="ow">in</span> <span class="n">protocols</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">location</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">proto</span><span class="p">):</span>
+ <span class="n">url</span> <span class="o">=</span> <span class="n">location</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">proto</span><span class="p">,</span> <span class="nb">str</span><span class="p">())</span>
+ <span class="n">host</span><span class="p">,</span> <span class="n">slash</span><span class="p">,</span> <span class="n">extra</span> <span class="o">=</span> <span class="n">url</span><span class="o">.</span><span class="n">partition</span><span class="p">(</span><span class="s">&#39;/&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">extra</span><span class="p">:</span> <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;URI text for </span><span class="si">%s</span><span class="s">: &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">host</span><span class="p">,</span> <span class="n">extra</span><span class="p">))</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got host string for keyserver setting: &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">host</span><span class="p">)</span>
+
+ <span class="n">host</span> <span class="o">=</span> <span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">host</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">host</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Cleaned host string: &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="n">host</span><span class="p">)</span>
+ <span class="n">keyserver</span> <span class="o">=</span> <span class="n">proto</span> <span class="o">+</span> <span class="n">host</span>
+ <span class="k">return</span> <span class="n">keyserver</span>
+ <span class="k">return</span> <span class="bp">None</span>
+</div>
+<div class="viewcode-block" id="_check_preferences"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._check_preferences">[docs]</a><span class="k">def</span> <span class="nf">_check_preferences</span><span class="p">(</span><span class="n">prefs</span><span class="p">,</span> <span class="n">pref_type</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check cipher, digest, and compression preference settings.</span>
+
+<span class="sd"> MD5 is not allowed. This is `not 1994`__. SHA1 is allowed_ grudgingly_.</span>
+
+<span class="sd"> __ http://www.cs.colorado.edu/~jrblack/papers/md5e-full.pdf</span>
+<span class="sd"> .. _allowed: http://eprint.iacr.org/2008/469.pdf</span>
+<span class="sd"> .. _grudgingly: https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">prefs</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span> <span class="k">return</span>
+
+ <span class="n">cipher</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;AES256&#39;</span><span class="p">,</span> <span class="s">&#39;AES192&#39;</span><span class="p">,</span> <span class="s">&#39;AES128&#39;</span><span class="p">,</span>
+ <span class="s">&#39;CAMELLIA256&#39;</span><span class="p">,</span> <span class="s">&#39;CAMELLIA192&#39;</span><span class="p">,</span>
+ <span class="s">&#39;TWOFISH&#39;</span><span class="p">,</span> <span class="s">&#39;3DES&#39;</span><span class="p">])</span>
+ <span class="n">digest</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;SHA512&#39;</span><span class="p">,</span> <span class="s">&#39;SHA384&#39;</span><span class="p">,</span> <span class="s">&#39;SHA256&#39;</span><span class="p">,</span> <span class="s">&#39;SHA224&#39;</span><span class="p">,</span> <span class="s">&#39;RMD160&#39;</span><span class="p">,</span>
+ <span class="s">&#39;SHA1&#39;</span><span class="p">])</span>
+ <span class="n">compress</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;BZIP2&#39;</span><span class="p">,</span> <span class="s">&#39;ZLIB&#39;</span><span class="p">,</span> <span class="s">&#39;ZIP&#39;</span><span class="p">,</span> <span class="s">&#39;Uncompressed&#39;</span><span class="p">])</span>
+ <span class="nb">all</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="n">cipher</span><span class="p">,</span> <span class="n">digest</span><span class="p">,</span> <span class="n">compress</span><span class="p">])</span>
+
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">prefs</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
+ <span class="n">prefs</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">prefs</span><span class="o">.</span><span class="n">split</span><span class="p">())</span>
+ <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">prefs</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
+ <span class="n">prefs</span> <span class="o">=</span> <span class="nb">set</span><span class="p">(</span><span class="n">prefs</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;prefs must be list of strings, or space-separated string&quot;</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;parsers._check_preferences(): </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">message</span><span class="p">)</span>
+ <span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="n">message</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">pref_type</span><span class="p">:</span>
+ <span class="n">pref_type</span> <span class="o">=</span> <span class="s">&#39;all&#39;</span>
+
+ <span class="n">allowed</span> <span class="o">=</span> <span class="nb">str</span><span class="p">()</span>
+
+ <span class="k">if</span> <span class="n">pref_type</span> <span class="o">==</span> <span class="s">&#39;cipher&#39;</span><span class="p">:</span>
+ <span class="n">allowed</span> <span class="o">+=</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefs</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">cipher</span><span class="p">))</span>
+ <span class="k">if</span> <span class="n">pref_type</span> <span class="o">==</span> <span class="s">&#39;digest&#39;</span><span class="p">:</span>
+ <span class="n">allowed</span> <span class="o">+=</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefs</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">digest</span><span class="p">))</span>
+ <span class="k">if</span> <span class="n">pref_type</span> <span class="o">==</span> <span class="s">&#39;compress&#39;</span><span class="p">:</span>
+ <span class="n">allowed</span> <span class="o">+=</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefs</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">compress</span><span class="p">))</span>
+ <span class="k">if</span> <span class="n">pref_type</span> <span class="o">==</span> <span class="s">&#39;all&#39;</span><span class="p">:</span>
+ <span class="n">allowed</span> <span class="o">+=</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefs</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="nb">all</span><span class="p">))</span>
+
+ <span class="k">return</span> <span class="n">allowed</span>
+</div>
+<div class="viewcode-block" id="_fix_unsafe"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._fix_unsafe">[docs]</a><span class="k">def</span> <span class="nf">_fix_unsafe</span><span class="p">(</span><span class="n">shell_input</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Find characters used to escape from a string into a shell, and wrap them in</span>
+<span class="sd"> quotes if they exist. Regex pilfered from Python3 :mod:`shlex` module.</span>
+
+<span class="sd"> :param str shell_input: The input intended for the GnuPG process.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">_unsafe</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">r&#39;[^\w@%+=:,./-]&#39;</span><span class="p">,</span> <span class="mi">256</span><span class="p">)</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">_unsafe</span><span class="o">.</span><span class="n">findall</span><span class="p">(</span><span class="n">shell_input</span><span class="p">))</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="k">return</span> <span class="n">shell_input</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">clean</span> <span class="o">=</span> <span class="s">&quot;&#39;&quot;</span> <span class="o">+</span> <span class="n">shell_input</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;&#39;&quot;</span><span class="p">,</span> <span class="s">&quot;&#39;</span><span class="se">\&quot;</span><span class="s">&#39;</span><span class="se">\&quot;</span><span class="s">&#39;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;&#39;&quot;</span>
+ <span class="k">return</span> <span class="n">clean</span>
+ <span class="k">except</span> <span class="ne">TypeError</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">None</span>
+</div>
+<div class="viewcode-block" id="_hyphenate"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._hyphenate">[docs]</a><span class="k">def</span> <span class="nf">_hyphenate</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">add_prefix</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Change underscores to hyphens so that object attributes can be easily</span>
+<span class="sd"> tranlated to GPG option names.</span>
+
+<span class="sd"> :param str input: The attribute to hyphenate.</span>
+<span class="sd"> :param bool add_prefix: If True, add leading hyphens to the input.</span>
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :return: The ``input`` with underscores changed to hyphens.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">ret</span> <span class="o">=</span> <span class="s">&#39;--&#39;</span> <span class="k">if</span> <span class="n">add_prefix</span> <span class="k">else</span> <span class="s">&#39;&#39;</span>
+ <span class="n">ret</span> <span class="o">+=</span> <span class="nb">input</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">,</span> <span class="s">&#39;-&#39;</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">ret</span>
+</div>
+<div class="viewcode-block" id="_is_allowed"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._is_allowed">[docs]</a><span class="k">def</span> <span class="nf">_is_allowed</span><span class="p">(</span><span class="nb">input</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that an option or argument given to GPG is in the set of allowed</span>
+<span class="sd"> options, the latter being a strict subset of the set of all options known</span>
+<span class="sd"> to GPG.</span>
+
+<span class="sd"> :param str input: An input meant to be parsed as an option or flag to the</span>
+<span class="sd"> GnuPG process. Should be formatted the same as an option</span>
+<span class="sd"> or flag to the commandline gpg, i.e. &quot;--encrypt-files&quot;.</span>
+
+<span class="sd"> :ivar frozenset gnupg_options: All known GPG options and flags.</span>
+
+<span class="sd"> :ivar frozenset allowed: All allowed GPG options and flags, e.g. all GPG</span>
+<span class="sd"> options and flags which we are willing to</span>
+<span class="sd"> acknowledge and parse. If we want to support a</span>
+<span class="sd"> new option, it will need to have its own parsing</span>
+<span class="sd"> class and its name will need to be added to this</span>
+<span class="sd"> set.</span>
+
+<span class="sd"> :raises: :exc:`UsageError` if **input** is not a subset of the hard-coded</span>
+<span class="sd"> set of all GnuPG options in :func:`_get_all_gnupg_options`.</span>
+
+<span class="sd"> :exc:`ProtectedOption` if **input** is not in the set of allowed</span>
+<span class="sd"> options.</span>
+
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :return: The original **input** parameter, unmodified and unsanitized, if</span>
+<span class="sd"> no errors occur.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">gnupg_options</span> <span class="o">=</span> <span class="n">_get_all_gnupg_options</span><span class="p">()</span>
+ <span class="n">allowed</span> <span class="o">=</span> <span class="n">_get_options_group</span><span class="p">(</span><span class="s">&quot;allowed&quot;</span><span class="p">)</span>
+
+ <span class="c">## these are the allowed options we will handle so far, all others should</span>
+ <span class="c">## be dropped. this dance is so that when new options are added later, we</span>
+ <span class="c">## merely add the to the _allowed list, and the `` _allowed.issubset``</span>
+ <span class="c">## assertion will check that GPG will recognise them</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="c">## check that allowed is a subset of all gnupg_options</span>
+ <span class="k">assert</span> <span class="n">allowed</span><span class="o">.</span><span class="n">issubset</span><span class="p">(</span><span class="n">gnupg_options</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">AssertionError</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="n">UsageError</span><span class="p">(</span><span class="s">&quot;&#39;allowed&#39; isn&#39;t a subset of known options, diff: </span><span class="si">%s</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="n">allowed</span><span class="o">.</span><span class="n">difference</span><span class="p">(</span><span class="n">gnupg_options</span><span class="p">))</span>
+
+ <span class="c">## if we got a list of args, join them</span>
+ <span class="c">##</span>
+ <span class="c">## see TODO file, tag :cleanup:</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
+ <span class="nb">input</span> <span class="o">=</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">input</span><span class="p">])</span>
+
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
+ <span class="k">if</span> <span class="nb">input</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&#39;_&#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="nb">input</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;--&#39;</span><span class="p">):</span>
+ <span class="n">hyphenated</span> <span class="o">=</span> <span class="n">_hyphenate</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">add_prefix</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">hyphenated</span> <span class="o">=</span> <span class="n">_hyphenate</span><span class="p">(</span><span class="nb">input</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">hyphenated</span> <span class="o">=</span> <span class="nb">input</span>
+ <span class="c">## xxx we probably want to use itertools.dropwhile here</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="n">hyphenated</span> <span class="ow">in</span> <span class="n">allowed</span>
+ <span class="k">except</span> <span class="ne">AssertionError</span> <span class="k">as</span> <span class="n">ae</span><span class="p">:</span>
+ <span class="n">dropped</span> <span class="o">=</span> <span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">hyphenated</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;_is_allowed(): Dropping option &#39;</span><span class="si">%s</span><span class="s">&#39;...&quot;</span> <span class="o">%</span> <span class="n">dropped</span><span class="p">)</span>
+ <span class="k">raise</span> <span class="n">ProtectedOption</span><span class="p">(</span><span class="s">&quot;Option &#39;</span><span class="si">%s</span><span class="s">&#39; not supported.&quot;</span> <span class="o">%</span> <span class="n">dropped</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">return</span> <span class="nb">input</span>
+ <span class="k">return</span> <span class="bp">None</span>
+</div>
+<div class="viewcode-block" id="_is_hex"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._is_hex">[docs]</a><span class="k">def</span> <span class="nf">_is_hex</span><span class="p">(</span><span class="n">string</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that a string is hexidecimal, with alphabetic characters</span>
+<span class="sd"> capitalized and without whitespace.</span>
+
+<span class="sd"> :param str string: The string to check.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">matched</span> <span class="o">=</span> <span class="n">HEXIDECIMAL</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">matched</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="nb">len</span><span class="p">(</span><span class="n">matched</span><span class="o">.</span><span class="n">group</span><span class="p">())</span> <span class="o">&gt;=</span> <span class="mi">2</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="bp">False</span>
+</div>
+<div class="viewcode-block" id="_is_string"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._is_string">[docs]</a><span class="k">def</span> <span class="nf">_is_string</span><span class="p">(</span><span class="n">thing</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Python character arrays are a mess.</span>
+
+<span class="sd"> If Python2, check if **thing** is an :obj:`unicode` or a :obj:`str`.</span>
+<span class="sd"> If Python3, check if **thing** is a :obj:`str`.</span>
+
+<span class="sd"> :param thing: The thing to check.</span>
+<span class="sd"> :returns: ``True`` if **thing** is a string according to whichever version</span>
+<span class="sd"> of Python we&#39;re running in.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span><span class="p">:</span> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">thing</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span> <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">thing</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_sanitise"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._sanitise">[docs]</a><span class="k">def</span> <span class="nf">_sanitise</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Take an arg or the key portion of a kwarg and check that it is in the</span>
+<span class="sd"> set of allowed GPG options and flags, and that it has the correct</span>
+<span class="sd"> type. Then, attempt to escape any unsafe characters. If an option is not</span>
+<span class="sd"> allowed, drop it with a logged warning. Returns a dictionary of all</span>
+<span class="sd"> sanitised, allowed options.</span>
+
+<span class="sd"> Each new option that we support that is not a boolean, but instead has</span>
+<span class="sd"> some additional inputs following it, i.e. &quot;--encrypt-file foo.txt&quot;, will</span>
+<span class="sd"> need some basic safety checks added here.</span>
+
+<span class="sd"> GnuPG has three-hundred and eighteen commandline flags. Also, not all</span>
+<span class="sd"> implementations of OpenPGP parse PGP packets and headers in the same way,</span>
+<span class="sd"> so there is added potential there for messing with calls to GPG.</span>
+
+<span class="sd"> For information on the PGP message format specification, see</span>
+<span class="sd"> :rfc:`1991`.</span>
+
+<span class="sd"> If you&#39;re asking, &quot;Is this *really* necessary?&quot;: No, not really -- we could</span>
+<span class="sd"> just follow the security precautions recommended by `this xkcd`__.</span>
+
+<span class="sd"> __ https://xkcd.com/1181/</span>
+
+<span class="sd"> :param str args: (optional) The boolean arguments which will be passed to</span>
+<span class="sd"> the GnuPG process.</span>
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: ``sanitised``</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+
+ <span class="c">## see TODO file, tag :cleanup:sanitise:</span>
+
+ <span class="k">def</span> <span class="nf">_check_option</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that a single ``arg`` is an allowed option.</span>
+
+<span class="sd"> If it is allowed, quote out any escape characters in ``value``, and</span>
+<span class="sd"> add the pair to :ivar:`sanitised`. Otherwise, drop them.</span>
+
+<span class="sd"> :param str arg: The arguments which will be passed to the GnuPG</span>
+<span class="sd"> process, and, optionally their corresponding values.</span>
+<span class="sd"> The values are any additional arguments following the</span>
+<span class="sd"> GnuPG option or flag. For example, if we wanted to</span>
+<span class="sd"> pass ``&quot;--encrypt --recipient isis@leap.se&quot;`` to</span>
+<span class="sd"> GnuPG, then ``&quot;--encrypt&quot;`` would be an arg without a</span>
+<span class="sd"> value, and ``&quot;--recipient&quot;`` would also be an arg,</span>
+<span class="sd"> with a value of ``&quot;isis@leap.se&quot;``.</span>
+
+<span class="sd"> :ivar list checked: The sanitised, allowed options and values.</span>
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: A string of the items in ``checked``, delimited by spaces.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">checked</span> <span class="o">=</span> <span class="nb">str</span><span class="p">()</span>
+ <span class="n">none_options</span> <span class="o">=</span> <span class="n">_get_options_group</span><span class="p">(</span><span class="s">&quot;none_options&quot;</span><span class="p">)</span>
+ <span class="n">hex_options</span> <span class="o">=</span> <span class="n">_get_options_group</span><span class="p">(</span><span class="s">&quot;hex_options&quot;</span><span class="p">)</span>
+ <span class="n">hex_or_none_options</span> <span class="o">=</span> <span class="n">_get_options_group</span><span class="p">(</span><span class="s">&quot;hex_or_none_options&quot;</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span><span class="p">:</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">list</span><span class="p">)</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">unicode</span><span class="p">):</span>
+ <span class="n">arg</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span>
+
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">flag</span> <span class="o">=</span> <span class="n">_is_allowed</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span>
+ <span class="k">assert</span> <span class="n">flag</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">,</span> <span class="s">&quot;_check_option(): got None for flag&quot;</span>
+ <span class="k">except</span> <span class="p">(</span><span class="ne">AssertionError</span><span class="p">,</span> <span class="n">ProtectedOption</span><span class="p">)</span> <span class="k">as</span> <span class="n">error</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;_check_option(): </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">str</span><span class="p">(</span><span class="n">error</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">flag</span> <span class="o">+</span> <span class="s">&#39; &#39;</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">_is_string</span><span class="p">(</span><span class="n">value</span><span class="p">):</span>
+ <span class="n">values</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">)</span>
+ <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">values</span><span class="p">:</span>
+ <span class="c">## these can be handled separately, without _fix_unsafe(),</span>
+ <span class="c">## because they are only allowed if they pass the regex</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">flag</span> <span class="ow">in</span> <span class="n">none_options</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">):</span>
+ <span class="k">continue</span>
+
+ <span class="k">if</span> <span class="n">flag</span> <span class="ow">in</span> <span class="n">hex_options</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">_is_hex</span><span class="p">(</span><span class="n">v</span><span class="p">):</span> <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">v</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&#39; not hex.&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">flag</span><span class="p">,</span> <span class="n">v</span><span class="p">))</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">flag</span> <span class="ow">in</span> <span class="n">hex_or_none_options</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="n">v</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Allowing &#39;</span><span class="si">%s</span><span class="s">&#39; for all keys&quot;</span> <span class="o">%</span> <span class="n">flag</span><span class="p">)</span>
+ <span class="k">continue</span>
+
+ <span class="k">elif</span> <span class="n">flag</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;--keyserver&#39;</span><span class="p">]:</span>
+ <span class="n">host</span> <span class="o">=</span> <span class="n">_check_keyserver</span><span class="p">(</span><span class="n">v</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">host</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Setting keyserver: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">host</span><span class="p">)</span>
+ <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">v</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span> <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Dropping keyserver: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">v</span><span class="p">)</span>
+ <span class="k">continue</span>
+
+ <span class="c">## the rest are strings, filenames, etc, and should be</span>
+ <span class="c">## shell escaped:</span>
+ <span class="n">val</span> <span class="o">=</span> <span class="n">_fix_unsafe</span><span class="p">(</span><span class="n">v</span><span class="p">)</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="ow">not</span> <span class="n">val</span> <span class="ow">is</span> <span class="bp">None</span>
+ <span class="k">assert</span> <span class="ow">not</span> <span class="n">val</span><span class="o">.</span><span class="n">isspace</span><span class="p">()</span>
+ <span class="k">assert</span> <span class="ow">not</span> <span class="n">v</span> <span class="ow">is</span> <span class="bp">None</span>
+ <span class="k">assert</span> <span class="ow">not</span> <span class="n">v</span><span class="o">.</span><span class="n">isspace</span><span class="p">()</span>
+ <span class="k">except</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Dropping </span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">flag</span><span class="p">,</span> <span class="n">v</span><span class="p">))</span>
+ <span class="k">continue</span>
+
+ <span class="k">if</span> <span class="n">flag</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;--encrypt&#39;</span><span class="p">,</span> <span class="s">&#39;--encrypt-files&#39;</span><span class="p">,</span> <span class="s">&#39;--decrypt&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--decrypt-files&#39;</span><span class="p">,</span> <span class="s">&#39;--import&#39;</span><span class="p">,</span> <span class="s">&#39;--verify&#39;</span><span class="p">]:</span>
+ <span class="k">if</span> <span class="p">(</span> <span class="p">(</span><span class="n">_util</span><span class="o">.</span><span class="n">_is_file</span><span class="p">(</span><span class="n">val</span><span class="p">))</span>
+ <span class="ow">or</span>
+ <span class="p">((</span><span class="n">flag</span> <span class="o">==</span> <span class="s">&#39;--verify&#39;</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="n">val</span> <span class="o">==</span> <span class="s">&#39;-&#39;</span><span class="p">))</span> <span class="p">):</span>
+ <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">val</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;</span><span class="si">%s</span><span class="s"> not file: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">flag</span><span class="p">,</span> <span class="n">val</span><span class="p">))</span>
+
+ <span class="k">elif</span> <span class="n">flag</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;--cipher-algo&#39;</span><span class="p">,</span> <span class="s">&#39;--personal-cipher-prefs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-cipher-preferences&#39;</span><span class="p">]:</span>
+ <span class="n">legit_algos</span> <span class="o">=</span> <span class="n">_check_preferences</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="s">&#39;cipher&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">legit_algos</span><span class="p">:</span> <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">legit_algos</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span> <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; is not cipher&quot;</span> <span class="o">%</span> <span class="n">val</span><span class="p">)</span>
+
+ <span class="k">elif</span> <span class="n">flag</span> <span class="ow">in</span> <span class="p">[</span><span class="s">&#39;--compress-algo&#39;</span><span class="p">,</span> <span class="s">&#39;--compression-algo&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-compress-prefs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-compress-preferences&#39;</span><span class="p">]:</span>
+ <span class="n">legit_algos</span> <span class="o">=</span> <span class="n">_check_preferences</span><span class="p">(</span><span class="n">val</span><span class="p">,</span> <span class="s">&#39;compress&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">legit_algos</span><span class="p">:</span> <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">legit_algos</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span> <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; not compress algo&quot;</span> <span class="o">%</span> <span class="n">val</span><span class="p">)</span>
+
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">checked</span> <span class="o">+=</span> <span class="p">(</span><span class="n">val</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;_check_option(): No checks for </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">val</span><span class="p">)</span>
+
+ <span class="k">return</span> <span class="n">checked</span>
+
+ <span class="n">is_flag</span> <span class="o">=</span> <span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">&#39;--&#39;</span><span class="p">)</span>
+
+ <span class="k">def</span> <span class="nf">_make_filo</span><span class="p">(</span><span class="n">args_string</span><span class="p">):</span>
+ <span class="n">filo</span> <span class="o">=</span> <span class="n">arg</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">)</span>
+ <span class="n">filo</span><span class="o">.</span><span class="n">reverse</span><span class="p">()</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;_make_filo(): Converted to reverse list: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">filo</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">filo</span>
+
+ <span class="k">def</span> <span class="nf">_make_groups</span><span class="p">(</span><span class="n">filo</span><span class="p">):</span>
+ <span class="n">groups</span> <span class="o">=</span> <span class="p">{}</span>
+ <span class="k">while</span> <span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">1</span><span class="p">:</span>
+ <span class="n">last</span> <span class="o">=</span> <span class="n">filo</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
+ <span class="k">if</span> <span class="n">is_flag</span><span class="p">(</span><span class="n">last</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got arg: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">last</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">last</span> <span class="o">==</span> <span class="s">&#39;--verify&#39;</span><span class="p">:</span>
+ <span class="n">groups</span><span class="p">[</span><span class="n">last</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">filo</span><span class="o">.</span><span class="n">pop</span><span class="p">())</span>
+ <span class="c">## accept the read-from-stdin arg:</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span> <span class="o">&gt;=</span> <span class="mi">1</span> <span class="ow">and</span> <span class="n">filo</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">==</span> <span class="s">&#39;-&#39;</span><span class="p">:</span>
+ <span class="n">groups</span><span class="p">[</span><span class="n">last</span><span class="p">]</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="s">&#39; - &#39;</span><span class="p">)</span> <span class="c">## gross hack</span>
+ <span class="n">filo</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">groups</span><span class="p">[</span><span class="n">last</span><span class="p">]</span> <span class="o">=</span> <span class="nb">str</span><span class="p">()</span>
+ <span class="k">while</span> <span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">is_flag</span><span class="p">(</span><span class="n">filo</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">]):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got value: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">filo</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
+ <span class="n">groups</span><span class="p">[</span><span class="n">last</span><span class="p">]</span> <span class="o">+=</span> <span class="p">(</span><span class="n">filo</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span> <span class="o">+</span> <span class="s">&quot; &quot;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">filo</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">is_flag</span><span class="p">(</span><span class="n">filo</span><span class="p">[</span><span class="mi">0</span><span class="p">]):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got value: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">filo</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
+ <span class="n">groups</span><span class="p">[</span><span class="n">last</span><span class="p">]</span> <span class="o">+=</span> <span class="n">filo</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;_make_groups(): Got solitary value: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">last</span><span class="p">)</span>
+ <span class="n">groups</span><span class="p">[</span><span class="s">&quot;xxx&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">last</span>
+ <span class="k">return</span> <span class="n">groups</span>
+
+ <span class="k">def</span> <span class="nf">_check_groups</span><span class="p">(</span><span class="n">groups</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got groups: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">groups</span><span class="p">)</span>
+ <span class="n">checked_groups</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="k">for</span> <span class="n">a</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">groups</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
+ <span class="n">v</span> <span class="o">=</span> <span class="bp">None</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span> <span class="k">else</span> <span class="n">v</span>
+ <span class="n">safe</span> <span class="o">=</span> <span class="n">_check_option</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">safe</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">safe</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span> <span class="o">==</span> <span class="s">&quot;&quot;</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Appending option: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">safe</span><span class="p">)</span>
+ <span class="n">checked_groups</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">safe</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;Dropped option: &#39;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&#39;&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">a</span><span class="p">,</span><span class="n">v</span><span class="p">))</span>
+ <span class="k">return</span> <span class="n">checked_groups</span>
+
+ <span class="k">if</span> <span class="n">args</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="n">option_groups</span> <span class="o">=</span> <span class="p">{}</span>
+ <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">args</span><span class="p">:</span>
+ <span class="c">## if we&#39;re given a string with a bunch of options in it split</span>
+ <span class="c">## them up and deal with them separately</span>
+ <span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">))</span> \
+ <span class="ow">or</span> <span class="p">(</span><span class="n">_util</span><span class="o">.</span><span class="n">_py3k</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">str</span><span class="p">)):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got arg string: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">arg</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">arg</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="n">filo</span> <span class="o">=</span> <span class="n">_make_filo</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span>
+ <span class="n">option_groups</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">_make_groups</span><span class="p">(</span><span class="n">filo</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">option_groups</span><span class="o">.</span><span class="n">update</span><span class="p">({</span> <span class="n">arg</span><span class="p">:</span> <span class="s">&quot;&quot;</span> <span class="p">})</span>
+ <span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got arg list: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">arg</span><span class="p">)</span>
+ <span class="n">arg</span><span class="o">.</span><span class="n">reverse</span><span class="p">()</span>
+ <span class="n">option_groups</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">_make_groups</span><span class="p">(</span><span class="n">arg</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;Got non-str/list arg: &#39;</span><span class="si">%s</span><span class="s">&#39;, type &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="p">(</span><span class="n">arg</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">arg</span><span class="p">)))</span>
+ <span class="n">checked</span> <span class="o">=</span> <span class="n">_check_groups</span><span class="p">(</span><span class="n">option_groups</span><span class="p">)</span>
+ <span class="n">sanitised</span> <span class="o">=</span> <span class="s">&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">x</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">checked</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">sanitised</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got None for args&quot;</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_sanitise_list"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._sanitise_list">[docs]</a><span class="k">def</span> <span class="nf">_sanitise_list</span><span class="p">(</span><span class="n">arg_list</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;A generator for iterating through a list of gpg options and sanitising</span>
+<span class="sd"> them.</span>
+
+<span class="sd"> :param list arg_list: A list of options and flags for GnuPG.</span>
+<span class="sd"> :rtype: generator</span>
+<span class="sd"> :returns: A generator whose next() method returns each of the items in</span>
+<span class="sd"> ``arg_list`` after calling ``_sanitise()`` with that item as a</span>
+<span class="sd"> parameter.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">arg_list</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
+ <span class="k">for</span> <span class="n">arg</span> <span class="ow">in</span> <span class="n">arg_list</span><span class="p">:</span>
+ <span class="n">safe_arg</span> <span class="o">=</span> <span class="n">_sanitise</span><span class="p">(</span><span class="n">arg</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">safe_arg</span> <span class="o">!=</span> <span class="s">&quot;&quot;</span><span class="p">:</span>
+ <span class="k">yield</span> <span class="n">safe_arg</span>
+</div>
+<div class="viewcode-block" id="_get_options_group"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._get_options_group">[docs]</a><span class="k">def</span> <span class="nf">_get_options_group</span><span class="p">(</span><span class="n">group</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Get a specific group of options which are allowed.&quot;&quot;&quot;</span>
+
+ <span class="c">#: These expect a hexidecimal keyid as their argument, and can be parsed</span>
+ <span class="c">#: with :func:`_is_hex`.</span>
+ <span class="n">hex_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--check-sigs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--default-key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--default-recipient&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--delete-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--delete-secret-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--delete-secret-and-public-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--desig-revoke&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export-secret-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export-secret-subkeys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--fingerprint&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--gen-revoke&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-public-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-secret-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-sigs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--recipient&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--recv-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--send-keys&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These options expect value which are left unchecked, though still run</span>
+ <span class="c">#: through :func:`_fix_unsafe`.</span>
+ <span class="n">unchecked_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--list-options&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--passphrase-fd&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--status-fd&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--verify-options&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These have their own parsers and don&#39;t really fit into a group</span>
+ <span class="n">other_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--debug-level&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--keyserver&#39;</span><span class="p">,</span>
+
+ <span class="p">])</span>
+ <span class="c">#: These should have a directory for an argument</span>
+ <span class="n">dir_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--homedir&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These expect a keyring or keyfile as their argument</span>
+ <span class="n">keyring_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--keyring&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--primary-keyring&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--secret-keyring&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--trustdb-name&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These expect a filename (or the contents of a file as a string) or None</span>
+ <span class="c">#: (meaning that they read from stdin)</span>
+ <span class="n">file_or_none_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--decrypt&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--decrypt-files&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--encrypt&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--encrypt-files&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--import&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--verify&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--verify-files&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These options expect a string. see :func:`_check_preferences`.</span>
+ <span class="n">pref_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--digest-algo&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--cipher-algo&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--compress-algo&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--compression-algo&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--cert-digest-algo&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-digest-prefs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-digest-preferences&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-cipher-prefs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-cipher-preferences&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-compress-prefs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--personal-compress-preferences&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--print-md&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These options expect no arguments</span>
+ <span class="n">none_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span><span class="s">&#39;--always-trust&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--armor&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--armour&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--batch&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--check-sigs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--check-trustdb&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--clearsign&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--debug-all&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--default-recipient-self&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--detach-sign&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export-ownertrust&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export-secret-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--export-secret-subkeys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--fingerprint&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--fixed-list-mode&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--gen-key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--import-ownertrust&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-config&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-packets&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-public-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-secret-keys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--list-sigs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-default-keyring&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-default-recipient&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-emit-version&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-options&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-tty&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-use-agent&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--no-verbose&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--print-mds&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--quiet&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--sign&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--symmetric&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--use-agent&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--verbose&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--version&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--with-colons&#39;</span><span class="p">,</span>
+ <span class="s">&#39;--yes&#39;</span><span class="p">,</span>
+ <span class="p">])</span>
+ <span class="c">#: These options expect either None or a hex string</span>
+ <span class="n">hex_or_none_options</span> <span class="o">=</span> <span class="n">hex_options</span><span class="o">.</span><span class="n">intersection</span><span class="p">(</span><span class="n">none_options</span><span class="p">)</span>
+ <span class="n">allowed</span> <span class="o">=</span> <span class="n">hex_options</span><span class="o">.</span><span class="n">union</span><span class="p">(</span><span class="n">unchecked_options</span><span class="p">,</span> <span class="n">other_options</span><span class="p">,</span> <span class="n">dir_options</span><span class="p">,</span>
+ <span class="n">keyring_options</span><span class="p">,</span> <span class="n">file_or_none_options</span><span class="p">,</span>
+ <span class="n">pref_options</span><span class="p">,</span> <span class="n">none_options</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">group</span> <span class="ow">and</span> <span class="n">group</span> <span class="ow">in</span> <span class="nb">locals</span><span class="p">()</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+ <span class="k">return</span> <span class="nb">locals</span><span class="p">()[</span><span class="n">group</span><span class="p">]</span>
+</div>
+<div class="viewcode-block" id="_get_all_gnupg_options"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers._get_all_gnupg_options">[docs]</a><span class="k">def</span> <span class="nf">_get_all_gnupg_options</span><span class="p">():</span>
+ <span class="sd">&quot;&quot;&quot;Get all GnuPG options and flags.</span>
+
+<span class="sd"> This is hardcoded within a local scope to reduce the chance of a tampered</span>
+<span class="sd"> GnuPG binary reporting falsified option sets, i.e. because certain options</span>
+<span class="sd"> (namedly the ``--no-options`` option, which prevents the usage of gpg.conf</span>
+<span class="sd"> files) are necessary and statically specified in</span>
+<span class="sd"> :meth:`gnupg._meta.GPGBase._make_args`, if the inputs into Python are</span>
+<span class="sd"> already controlled, and we were to summon the GnuPG binary to ask it for</span>
+<span class="sd"> its options, it would be possible to receive a falsified options set</span>
+<span class="sd"> missing the ``--no-options`` option in response. This seems unlikely, and</span>
+<span class="sd"> the method is stupid and ugly, but at least we&#39;ll never have to debug</span>
+<span class="sd"> whether or not an option *actually* disappeared in a different GnuPG</span>
+<span class="sd"> version, or some funny business is happening.</span>
+
+<span class="sd"> These are the options as of GnuPG 1.4.12; the current stable branch of the</span>
+<span class="sd"> 2.1.x tree contains a few more -- if you need them you&#39;ll have to add them</span>
+<span class="sd"> in here.</span>
+
+<span class="sd"> :type gnupg_options: frozenset</span>
+<span class="sd"> :ivar gnupg_options: All known GPG options and flags.</span>
+<span class="sd"> :rtype: frozenset</span>
+<span class="sd"> :returns: ``gnupg_options``</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">three_hundred_eighteen</span> <span class="o">=</span> <span class="p">(</span><span class="s">&quot;&quot;&quot;</span>
+<span class="s">--allow-freeform-uid --multifile</span>
+<span class="s">--allow-multiple-messages --no</span>
+<span class="s">--allow-multisig-verification --no-allow-freeform-uid</span>
+<span class="s">--allow-non-selfsigned-uid --no-allow-multiple-messages</span>
+<span class="s">--allow-secret-key-import --no-allow-non-selfsigned-uid</span>
+<span class="s">--always-trust --no-armor</span>
+<span class="s">--armor --no-armour</span>
+<span class="s">--armour --no-ask-cert-expire</span>
+<span class="s">--ask-cert-expire --no-ask-cert-level</span>
+<span class="s">--ask-cert-level --no-ask-sig-expire</span>
+<span class="s">--ask-sig-expire --no-auto-check-trustdb</span>
+<span class="s">--attribute-fd --no-auto-key-locate</span>
+<span class="s">--attribute-file --no-auto-key-retrieve</span>
+<span class="s">--auto-check-trustdb --no-batch</span>
+<span class="s">--auto-key-locate --no-comments</span>
+<span class="s">--auto-key-retrieve --no-default-keyring</span>
+<span class="s">--batch --no-default-recipient</span>
+<span class="s">--bzip2-compress-level --no-disable-mdc</span>
+<span class="s">--bzip2-decompress-lowmem --no-emit-version</span>
+<span class="s">--card-edit --no-encrypt-to</span>
+<span class="s">--card-status --no-escape-from-lines</span>
+<span class="s">--cert-digest-algo --no-expensive-trust-checks</span>
+<span class="s">--cert-notation --no-expert</span>
+<span class="s">--cert-policy-url --no-force-mdc</span>
+<span class="s">--change-pin --no-force-v3-sigs</span>
+<span class="s">--charset --no-force-v4-certs</span>
+<span class="s">--check-sig --no-for-your-eyes-only</span>
+<span class="s">--check-sigs --no-greeting</span>
+<span class="s">--check-trustdb --no-groups</span>
+<span class="s">--cipher-algo --no-literal</span>
+<span class="s">--clearsign --no-mangle-dos-filenames</span>
+<span class="s">--command-fd --no-mdc-warning</span>
+<span class="s">--command-file --no-options</span>
+<span class="s">--comment --no-permission-warning</span>
+<span class="s">--completes-needed --no-pgp2</span>
+<span class="s">--compress-algo --no-pgp6</span>
+<span class="s">--compression-algo --no-pgp7</span>
+<span class="s">--compress-keys --no-pgp8</span>
+<span class="s">--compress-level --no-random-seed-file</span>
+<span class="s">--compress-sigs --no-require-backsigs</span>
+<span class="s">--ctapi-driver --no-require-cross-certification</span>
+<span class="s">--dearmor --no-require-secmem</span>
+<span class="s">--dearmour --no-rfc2440-text</span>
+<span class="s">--debug --no-secmem-warning</span>
+<span class="s">--debug-all --no-show-notation</span>
+<span class="s">--debug-ccid-driver --no-show-photos</span>
+<span class="s">--debug-level --no-show-policy-url</span>
+<span class="s">--decrypt --no-sig-cache</span>
+<span class="s">--decrypt-files --no-sig-create-check</span>
+<span class="s">--default-cert-check-level --no-sk-comments</span>
+<span class="s">--default-cert-expire --no-strict</span>
+<span class="s">--default-cert-level --notation-data</span>
+<span class="s">--default-comment --not-dash-escaped</span>
+<span class="s">--default-key --no-textmode</span>
+<span class="s">--default-keyserver-url --no-throw-keyid</span>
+<span class="s">--default-preference-list --no-throw-keyids</span>
+<span class="s">--default-recipient --no-tty</span>
+<span class="s">--default-recipient-self --no-use-agent</span>
+<span class="s">--default-sig-expire --no-use-embedded-filename</span>
+<span class="s">--delete-keys --no-utf8-strings</span>
+<span class="s">--delete-secret-and-public-keys --no-verbose</span>
+<span class="s">--delete-secret-keys --no-version</span>
+<span class="s">--desig-revoke --openpgp</span>
+<span class="s">--detach-sign --options</span>
+<span class="s">--digest-algo --output</span>
+<span class="s">--disable-ccid --override-session-key</span>
+<span class="s">--disable-cipher-algo --passphrase</span>
+<span class="s">--disable-dsa2 --passphrase-fd</span>
+<span class="s">--disable-mdc --passphrase-file</span>
+<span class="s">--disable-pubkey-algo --passphrase-repeat</span>
+<span class="s">--display --pcsc-driver</span>
+<span class="s">--display-charset --personal-cipher-preferences</span>
+<span class="s">--dry-run --personal-cipher-prefs</span>
+<span class="s">--dump-options --personal-compress-preferences</span>
+<span class="s">--edit-key --personal-compress-prefs</span>
+<span class="s">--emit-version --personal-digest-preferences</span>
+<span class="s">--enable-dsa2 --personal-digest-prefs</span>
+<span class="s">--enable-progress-filter --pgp2</span>
+<span class="s">--enable-special-filenames --pgp6</span>
+<span class="s">--enarmor --pgp7</span>
+<span class="s">--enarmour --pgp8</span>
+<span class="s">--encrypt --photo-viewer</span>
+<span class="s">--encrypt-files --pipemode</span>
+<span class="s">--encrypt-to --preserve-permissions</span>
+<span class="s">--escape-from-lines --primary-keyring</span>
+<span class="s">--exec-path --print-md</span>
+<span class="s">--exit-on-status-write-error --print-mds</span>
+<span class="s">--expert --quick-random</span>
+<span class="s">--export --quiet</span>
+<span class="s">--export-options --reader-port</span>
+<span class="s">--export-ownertrust --rebuild-keydb-caches</span>
+<span class="s">--export-secret-keys --recipient</span>
+<span class="s">--export-secret-subkeys --recv-keys</span>
+<span class="s">--fast-import --refresh-keys</span>
+<span class="s">--fast-list-mode --remote-user</span>
+<span class="s">--fetch-keys --require-backsigs</span>
+<span class="s">--fingerprint --require-cross-certification</span>
+<span class="s">--fixed-list-mode --require-secmem</span>
+<span class="s">--fix-trustdb --rfc1991</span>
+<span class="s">--force-mdc --rfc2440</span>
+<span class="s">--force-ownertrust --rfc2440-text</span>
+<span class="s">--force-v3-sigs --rfc4880</span>
+<span class="s">--force-v4-certs --run-as-shm-coprocess</span>
+<span class="s">--for-your-eyes-only --s2k-cipher-algo</span>
+<span class="s">--gen-key --s2k-count</span>
+<span class="s">--gen-prime --s2k-digest-algo</span>
+<span class="s">--gen-random --s2k-mode</span>
+<span class="s">--gen-revoke --search-keys</span>
+<span class="s">--gnupg --secret-keyring</span>
+<span class="s">--gpg-agent-info --send-keys</span>
+<span class="s">--gpgconf-list --set-filename</span>
+<span class="s">--gpgconf-test --set-filesize</span>
+<span class="s">--group --set-notation</span>
+<span class="s">--help --set-policy-url</span>
+<span class="s">--hidden-encrypt-to --show-keyring</span>
+<span class="s">--hidden-recipient --show-notation</span>
+<span class="s">--homedir --show-photos</span>
+<span class="s">--honor-http-proxy --show-policy-url</span>
+<span class="s">--ignore-crc-error --show-session-key</span>
+<span class="s">--ignore-mdc-error --sig-keyserver-url</span>
+<span class="s">--ignore-time-conflict --sign</span>
+<span class="s">--ignore-valid-from --sign-key</span>
+<span class="s">--import --sig-notation</span>
+<span class="s">--import-options --sign-with</span>
+<span class="s">--import-ownertrust --sig-policy-url</span>
+<span class="s">--interactive --simple-sk-checksum</span>
+<span class="s">--keyid-format --sk-comments</span>
+<span class="s">--keyring --skip-verify</span>
+<span class="s">--keyserver --status-fd</span>
+<span class="s">--keyserver-options --status-file</span>
+<span class="s">--lc-ctype --store</span>
+<span class="s">--lc-messages --strict</span>
+<span class="s">--limit-card-insert-tries --symmetric</span>
+<span class="s">--list-config --temp-directory</span>
+<span class="s">--list-key --textmode</span>
+<span class="s">--list-keys --throw-keyid</span>
+<span class="s">--list-only --throw-keyids</span>
+<span class="s">--list-options --trustdb-name</span>
+<span class="s">--list-ownertrust --trusted-key</span>
+<span class="s">--list-packets --trust-model</span>
+<span class="s">--list-public-keys --try-all-secrets</span>
+<span class="s">--list-secret-keys --ttyname</span>
+<span class="s">--list-sig --ttytype</span>
+<span class="s">--list-sigs --ungroup</span>
+<span class="s">--list-trustdb --update-trustdb</span>
+<span class="s">--load-extension --use-agent</span>
+<span class="s">--local-user --use-embedded-filename</span>
+<span class="s">--lock-multiple --user</span>
+<span class="s">--lock-never --utf8-strings</span>
+<span class="s">--lock-once --verbose</span>
+<span class="s">--logger-fd --verify</span>
+<span class="s">--logger-file --verify-files</span>
+<span class="s">--lsign-key --verify-options</span>
+<span class="s">--mangle-dos-filenames --version</span>
+<span class="s">--marginals-needed --warranty</span>
+<span class="s">--max-cert-depth --with-colons</span>
+<span class="s">--max-output --with-fingerprint</span>
+<span class="s">--merge-only --with-key-data</span>
+<span class="s">--min-cert-level --yes</span>
+<span class="s">&quot;&quot;&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+
+ <span class="c"># These are extra options which only exist for GnuPG&gt;=2.0.0</span>
+ <span class="n">three_hundred_eighteen</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--export-ownertrust&#39;</span><span class="p">)</span>
+ <span class="n">three_hundred_eighteen</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;--import-ownertrust&#39;</span><span class="p">)</span>
+
+ <span class="n">gnupg_options</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">(</span><span class="n">three_hundred_eighteen</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">gnupg_options</span>
+</div>
+<div class="viewcode-block" id="nodata"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.nodata">[docs]</a><span class="k">def</span> <span class="nf">nodata</span><span class="p">(</span><span class="n">status_code</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Translate NODATA status codes from GnuPG to messages.&quot;&quot;&quot;</span>
+ <span class="n">lookup</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="s">&#39;1&#39;</span><span class="p">:</span> <span class="s">&#39;No armored data.&#39;</span><span class="p">,</span>
+ <span class="s">&#39;2&#39;</span><span class="p">:</span> <span class="s">&#39;Expected a packet but did not find one.&#39;</span><span class="p">,</span>
+ <span class="s">&#39;3&#39;</span><span class="p">:</span> <span class="s">&#39;Invalid packet found, this may indicate a non OpenPGP message.&#39;</span><span class="p">,</span>
+ <span class="s">&#39;4&#39;</span><span class="p">:</span> <span class="s">&#39;Signature expected but not found.&#39;</span> <span class="p">}</span>
+ <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">lookup</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
+ <span class="k">if</span> <span class="nb">str</span><span class="p">(</span><span class="n">status_code</span><span class="p">)</span> <span class="o">==</span> <span class="n">key</span><span class="p">:</span>
+ <span class="k">return</span> <span class="n">value</span>
+</div>
+<div class="viewcode-block" id="progress"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.progress">[docs]</a><span class="k">def</span> <span class="nf">progress</span><span class="p">(</span><span class="n">status_code</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Translate PROGRESS status codes from GnuPG to messages.&quot;&quot;&quot;</span>
+ <span class="n">lookup</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="s">&#39;pk_dsa&#39;</span><span class="p">:</span> <span class="s">&#39;DSA key generation&#39;</span><span class="p">,</span>
+ <span class="s">&#39;pk_elg&#39;</span><span class="p">:</span> <span class="s">&#39;Elgamal key generation&#39;</span><span class="p">,</span>
+ <span class="s">&#39;primegen&#39;</span><span class="p">:</span> <span class="s">&#39;Prime generation&#39;</span><span class="p">,</span>
+ <span class="s">&#39;need_entropy&#39;</span><span class="p">:</span> <span class="s">&#39;Waiting for new entropy in the RNG&#39;</span><span class="p">,</span>
+ <span class="s">&#39;tick&#39;</span><span class="p">:</span> <span class="s">&#39;Generic tick without any special meaning - still working.&#39;</span><span class="p">,</span>
+ <span class="s">&#39;starting_agent&#39;</span><span class="p">:</span> <span class="s">&#39;A gpg-agent was started.&#39;</span><span class="p">,</span>
+ <span class="s">&#39;learncard&#39;</span><span class="p">:</span> <span class="s">&#39;gpg-agent or gpgsm is learning the smartcard data.&#39;</span><span class="p">,</span>
+ <span class="s">&#39;card_busy&#39;</span><span class="p">:</span> <span class="s">&#39;A smartcard is still working.&#39;</span> <span class="p">}</span>
+ <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">lookup</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
+ <span class="k">if</span> <span class="nb">str</span><span class="p">(</span><span class="n">status_code</span><span class="p">)</span> <span class="o">==</span> <span class="n">key</span><span class="p">:</span>
+ <span class="k">return</span> <span class="n">value</span>
+
+</div>
+<div class="viewcode-block" id="GenKey"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.GenKey">[docs]</a><span class="k">class</span> <span class="nc">GenKey</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Handle status messages for key generation.</span>
+
+<span class="sd"> Calling the ``__str__()`` method of this class will return the generated</span>
+<span class="sd"> key&#39;s fingerprint, or a status string explaining the results.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="c">## this should get changed to something more useful, like &#39;key_type&#39;</span>
+ <span class="c">#: &#39;P&#39;:= primary, &#39;S&#39;:= subkey, &#39;B&#39;:= both</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">subkey_created</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">primary_created</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="c">#: This will store the key&#39;s public keyring filename, if</span>
+ <span class="c">#: :meth:`~gnupg.GPG.gen_key_input` was called with</span>
+ <span class="c">#: ``separate_keyring=True``.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">keyring</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: This will store the key&#39;s secret keyring filename, if :</span>
+ <span class="c">#: :meth:`~gnupg.GPG.gen_key_input` was called with</span>
+ <span class="c">#: ``separate_keyring=True``.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">secring</span> <span class="o">=</span> <span class="bp">None</span>
+
+ <span class="k">def</span> <span class="nf">__nonzero__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">:</span> <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="bp">False</span>
+ <span class="n">__bool__</span> <span class="o">=</span> <span class="n">__nonzero__</span>
+
+ <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">False</span>
+
+<div class="viewcode-block" id="GenKey._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.GenKey._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;GOOD_PASSPHRASE&quot;</span><span class="p">):</span>
+ <span class="k">pass</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEY_NOT_CREATED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;key not created&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEY_CREATED&quot;</span><span class="p">:</span>
+ <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">)</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;key created&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;NODATA&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">nodata</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;PROGRESS&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">progress</span><span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">])</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Unknown status message: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&#39;B&#39;</span><span class="p">,</span> <span class="s">&#39;P&#39;</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">primary_created</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&#39;B&#39;</span><span class="p">,</span> <span class="s">&#39;S&#39;</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">subkey_created</span> <span class="o">=</span> <span class="bp">True</span>
+</div></div>
+<div class="viewcode-block" id="DeleteResult"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.DeleteResult">[docs]</a><span class="k">class</span> <span class="nc">DeleteResult</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Handle status messages for --delete-keys and --delete-secret-keys&quot;&quot;&quot;</span>
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;ok&#39;</span>
+
+ <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">status</span>
+
+ <span class="n">problem_reason</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&#39;1&#39;</span><span class="p">:</span> <span class="s">&#39;No such key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;2&#39;</span><span class="p">:</span> <span class="s">&#39;Must delete secret key first&#39;</span><span class="p">,</span>
+ <span class="s">&#39;3&#39;</span><span class="p">:</span> <span class="s">&#39;Ambigious specification&#39;</span><span class="p">,</span> <span class="p">}</span>
+
+<div class="viewcode-block" id="DeleteResult._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.DeleteResult._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;DELETE_PROBLEM&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">problem_reason</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="s">&quot;Unknown error: </span><span class="si">%r</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="n">value</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Unknown status message: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
+</div></div>
+<div class="viewcode-block" id="Sign"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.Sign">[docs]</a><span class="k">class</span> <span class="nc">Sign</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse GnuPG status messages for signing operations.</span>
+
+<span class="sd"> :param gpg: An instance of :class:`gnupg.GPG`.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+
+ <span class="c">#: The type of signature created.</span>
+ <span class="n">sig_type</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The algorithm used to create the signature.</span>
+ <span class="n">sig_algo</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The hash algorithm used to create the signature.</span>
+ <span class="n">sig_hash_also</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The fingerprint of the signing keyid.</span>
+ <span class="n">fingerprint</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The timestamp on the signature.</span>
+ <span class="n">timestamp</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: xxx fill me in</span>
+ <span class="n">what</span> <span class="o">=</span> <span class="bp">None</span>
+
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+
+ <span class="k">def</span> <span class="nf">__nonzero__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Override the determination for truthfulness evaluation.</span>
+
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if we have a valid signature, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span>
+ <span class="n">__bool__</span> <span class="o">=</span> <span class="n">__nonzero__</span>
+
+ <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span><span class="o">.</span><span class="n">_encoding</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span><span class="o">.</span><span class="n">_decode_errors</span><span class="p">)</span>
+
+<div class="viewcode-block" id="Sign._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.Sign._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;USERID_HINT&quot;</span><span class="p">,</span> <span class="s">&quot;NEED_PASSPHRASE&quot;</span><span class="p">,</span> <span class="s">&quot;BAD_PASSPHRASE&quot;</span><span class="p">,</span>
+ <span class="s">&quot;GOOD_PASSPHRASE&quot;</span><span class="p">,</span> <span class="s">&quot;BEGIN_SIGNING&quot;</span><span class="p">,</span> <span class="s">&quot;CARDCTRL&quot;</span><span class="p">,</span>
+ <span class="s">&quot;INV_SGNR&quot;</span><span class="p">,</span> <span class="s">&quot;SIGEXPIRED&quot;</span><span class="p">):</span>
+ <span class="k">pass</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;SIG_CREATED&quot;</span><span class="p">:</span>
+ <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sig_type</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">sig_algo</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">sig_hash_algo</span><span class="p">,</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">what</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">timestamp</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">)</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEYEXPIRED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&quot;skipped signing key, key expired&quot;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">+=</span> <span class="s">&quot; on {}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">value</span><span class="p">))</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEYREVOKED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&quot;skipped signing key, key revoked&quot;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">value</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">+=</span> <span class="s">&quot; on {}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">value</span><span class="p">))</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;NODATA&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">nodata</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Unknown status message: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
+</div></div>
+<div class="viewcode-block" id="ListKeys"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListKeys">[docs]</a><span class="k">class</span> <span class="nc">ListKeys</span><span class="p">(</span><span class="nb">list</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Handle status messages for --list-keys.</span>
+
+<span class="sd"> Handles pub and uid (relating the latter to the former). Don&#39;t care about</span>
+<span class="sd"> the following attributes/status messages (from doc/DETAILS):</span>
+
+<span class="sd"> | crt = X.509 certificate</span>
+<span class="sd"> | crs = X.509 certificate and private key available</span>
+<span class="sd"> | ssb = secret subkey (secondary key)</span>
+<span class="sd"> | uat = user attribute (same as user id except for field 10).</span>
+<span class="sd"> | sig = signature</span>
+<span class="sd"> | rev = revocation signature</span>
+<span class="sd"> | pkd = public key data (special field format, see below)</span>
+<span class="sd"> | grp = reserved for gpgsm</span>
+<span class="sd"> | rvk = revocation key</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="nb">super</span><span class="p">(</span><span class="n">ListKeys</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">()</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fingerprints</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">uids</span> <span class="o">=</span> <span class="p">[]</span>
+
+<div class="viewcode-block" id="ListKeys.key"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListKeys.key">[docs]</a> <span class="k">def</span> <span class="nf">key</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
+ <span class="nb">vars</span> <span class="o">=</span> <span class="p">(</span><span class="s">&quot;&quot;&quot;</span>
+<span class="s"> type trust length algo keyid date expires dummy ownertrust uid</span>
+<span class="s"> &quot;&quot;&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span> <span class="o">=</span> <span class="p">{}</span>
+ <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="nb">vars</span><span class="p">)):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="nb">vars</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;uids&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;uid&#39;</span><span class="p">]:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;uids&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;uid&#39;</span><span class="p">])</span>
+ <span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;uid&#39;</span><span class="p">]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;subkeys&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">)</span>
+</div>
+ <span class="n">pub</span> <span class="o">=</span> <span class="n">sec</span> <span class="o">=</span> <span class="n">key</span>
+
+<div class="viewcode-block" id="ListKeys.fpr"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListKeys.fpr">[docs]</a> <span class="k">def</span> <span class="nf">fpr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;fingerprint&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">9</span><span class="p">]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fingerprints</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">9</span><span class="p">])</span>
+</div>
+<div class="viewcode-block" id="ListKeys.uid"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListKeys.uid">[docs]</a> <span class="k">def</span> <span class="nf">uid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
+ <span class="n">uid</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">9</span><span class="p">]</span>
+ <span class="n">uid</span> <span class="o">=</span> <span class="n">ESCAPE_PATTERN</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="k">lambda</span> <span class="n">m</span><span class="p">:</span> <span class="nb">chr</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">m</span><span class="o">.</span><span class="n">group</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="mi">16</span><span class="p">)),</span> <span class="n">uid</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;uids&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">uid</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">uids</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">uid</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="ListKeys.sub"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListKeys.sub">[docs]</a> <span class="k">def</span> <span class="nf">sub</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">args</span><span class="p">):</span>
+ <span class="n">subkey</span> <span class="o">=</span> <span class="p">[</span><span class="n">args</span><span class="p">[</span><span class="mi">4</span><span class="p">],</span> <span class="n">args</span><span class="p">[</span><span class="mi">11</span><span class="p">]]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">curkey</span><span class="p">[</span><span class="s">&#39;subkeys&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">subkey</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="ListKeys._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListKeys._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="k">pass</span>
+
+</div></div>
+<div class="viewcode-block" id="ImportResult"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ImportResult">[docs]</a><span class="k">class</span> <span class="nc">ImportResult</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse GnuPG status messages for key import operations.</span>
+
+<span class="sd"> :type gpg: :class:`gnupg.GPG`</span>
+<span class="sd"> :param gpg: An instance of :class:`gnupg.GPG`.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">_ok_reason</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;0&#39;</span><span class="p">:</span> <span class="s">&#39;Not actually changed&#39;</span><span class="p">,</span>
+ <span class="s">&#39;1&#39;</span><span class="p">:</span> <span class="s">&#39;Entirely new key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;2&#39;</span><span class="p">:</span> <span class="s">&#39;New user IDs&#39;</span><span class="p">,</span>
+ <span class="s">&#39;4&#39;</span><span class="p">:</span> <span class="s">&#39;New signatures&#39;</span><span class="p">,</span>
+ <span class="s">&#39;8&#39;</span><span class="p">:</span> <span class="s">&#39;New subkeys&#39;</span><span class="p">,</span>
+ <span class="s">&#39;16&#39;</span><span class="p">:</span> <span class="s">&#39;Contains private key&#39;</span><span class="p">,</span>
+ <span class="s">&#39;17&#39;</span><span class="p">:</span> <span class="s">&#39;Contains private key&#39;</span><span class="p">,}</span>
+
+ <span class="n">_problem_reason</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&#39;0&#39;</span><span class="p">:</span> <span class="s">&#39;No specific reason given&#39;</span><span class="p">,</span>
+ <span class="s">&#39;1&#39;</span><span class="p">:</span> <span class="s">&#39;Invalid Certificate&#39;</span><span class="p">,</span>
+ <span class="s">&#39;2&#39;</span><span class="p">:</span> <span class="s">&#39;Issuer Certificate missing&#39;</span><span class="p">,</span>
+ <span class="s">&#39;3&#39;</span><span class="p">:</span> <span class="s">&#39;Certificate Chain too long&#39;</span><span class="p">,</span>
+ <span class="s">&#39;4&#39;</span><span class="p">:</span> <span class="s">&#39;Error storing certificate&#39;</span><span class="p">,</span> <span class="p">}</span>
+
+ <span class="n">_fields</span> <span class="o">=</span> <span class="s">&#39;&#39;&#39;count no_user_id imported imported_rsa unchanged</span>
+<span class="s"> n_uids n_subk n_sigs n_revoc sec_read sec_imported sec_dups</span>
+<span class="s"> not_imported&#39;&#39;&#39;</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="n">_counts</span> <span class="o">=</span> <span class="n">OrderedDict</span><span class="p">(</span>
+ <span class="nb">zip</span><span class="p">(</span><span class="n">_fields</span><span class="p">,</span> <span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">_fields</span><span class="p">))])</span> <span class="p">)</span>
+
+ <span class="c">#: A list of strings containing the fingerprints of the GnuPG keyIDs</span>
+ <span class="c">#: imported.</span>
+ <span class="n">fingerprints</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
+
+ <span class="c">#: A list containing dictionaries with information gathered on keys</span>
+ <span class="c">#: imported.</span>
+ <span class="n">results</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
+
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">counts</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_counts</span>
+
+ <span class="k">def</span> <span class="nf">__nonzero__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Override the determination for truthfulness evaluation.</span>
+
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if we have immport some keys, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">counts</span><span class="o">.</span><span class="n">not_imported</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span> <span class="k">return</span> <span class="bp">False</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">fingerprints</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span> <span class="k">return</span> <span class="bp">False</span>
+ <span class="k">return</span> <span class="bp">True</span>
+ <span class="n">__bool__</span> <span class="o">=</span> <span class="n">__nonzero__</span>
+
+<div class="viewcode-block" id="ImportResult._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ImportResult._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;IMPORTED&quot;</span><span class="p">:</span>
+ <span class="c"># this duplicates info we already see in import_ok &amp; import_problem</span>
+ <span class="k">pass</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;NODATA&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&#39;fingerprint&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
+ <span class="s">&#39;status&#39;</span><span class="p">:</span> <span class="s">&#39;No valid data found&#39;</span><span class="p">})</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;IMPORT_OK&quot;</span><span class="p">:</span>
+ <span class="n">reason</span><span class="p">,</span> <span class="n">fingerprint</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="n">reasons</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="k">for</span> <span class="n">code</span><span class="p">,</span> <span class="n">text</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_ok_reason</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
+ <span class="k">if</span> <span class="nb">int</span><span class="p">(</span><span class="n">reason</span><span class="p">)</span> <span class="o">==</span> <span class="nb">int</span><span class="p">(</span><span class="n">code</span><span class="p">):</span>
+ <span class="n">reasons</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">text</span><span class="p">)</span>
+ <span class="n">reasontext</span> <span class="o">=</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">reasons</span><span class="p">)</span> <span class="o">+</span> <span class="s">&quot;</span><span class="se">\n</span><span class="s">&quot;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&#39;fingerprint&#39;</span><span class="p">:</span> <span class="n">fingerprint</span><span class="p">,</span>
+ <span class="s">&#39;status&#39;</span><span class="p">:</span> <span class="n">reasontext</span><span class="p">})</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fingerprints</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">fingerprint</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;IMPORT_PROBLEM&quot;</span><span class="p">:</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">reason</span><span class="p">,</span> <span class="n">fingerprint</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="k">except</span><span class="p">:</span>
+ <span class="n">reason</span> <span class="o">=</span> <span class="n">value</span>
+ <span class="n">fingerprint</span> <span class="o">=</span> <span class="s">&#39;&lt;unknown&gt;&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">({</span><span class="s">&#39;fingerprint&#39;</span><span class="p">:</span> <span class="n">fingerprint</span><span class="p">,</span>
+ <span class="s">&#39;status&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">_problem_reason</span><span class="p">[</span><span class="n">reason</span><span class="p">]})</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;IMPORT_RES&quot;</span><span class="p">:</span>
+ <span class="n">import_res</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">counts</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">counts</span><span class="p">[</span><span class="n">x</span><span class="p">]</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">import_res</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEYEXPIRED&quot;</span><span class="p">:</span>
+ <span class="n">res</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;fingerprint&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
+ <span class="s">&#39;status&#39;</span><span class="p">:</span> <span class="s">&#39;Key expired&#39;</span><span class="p">}</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
+ <span class="c">## Accoring to docs/DETAILS L859, SIGEXPIRED is obsolete:</span>
+ <span class="c">## &quot;Removed on 2011-02-04. This is deprecated in favor of KEYEXPIRED.&quot;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;SIGEXPIRED&quot;</span><span class="p">:</span>
+ <span class="n">res</span> <span class="o">=</span> <span class="p">{</span><span class="s">&#39;fingerprint&#39;</span><span class="p">:</span> <span class="bp">None</span><span class="p">,</span>
+ <span class="s">&#39;status&#39;</span><span class="p">:</span> <span class="s">&#39;Signature expired&#39;</span><span class="p">}</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">results</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">res</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Unknown status message: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="ImportResult.summary"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ImportResult.summary">[docs]</a> <span class="k">def</span> <span class="nf">summary</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="n">l</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="n">l</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%d</span><span class="s"> imported&#39;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">counts</span><span class="p">[</span><span class="s">&#39;imported&#39;</span><span class="p">])</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">counts</span><span class="p">[</span><span class="s">&#39;not_imported&#39;</span><span class="p">]:</span>
+ <span class="n">l</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%d</span><span class="s"> not imported&#39;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">counts</span><span class="p">[</span><span class="s">&#39;not_imported&#39;</span><span class="p">])</span>
+ <span class="k">return</span> <span class="s">&#39;, &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">l</span><span class="p">)</span>
+
+</div></div>
+<div class="viewcode-block" id="Verify"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.Verify">[docs]</a><span class="k">class</span> <span class="nc">Verify</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parser for status messages from GnuPG for certifications and signature</span>
+<span class="sd"> verifications.</span>
+
+<span class="sd"> People often mix these up, or think that they are the same thing. While it</span>
+<span class="sd"> is true that certifications and signatures *are* the same cryptographic</span>
+<span class="sd"> operation -- and also true that both are the same as the decryption</span>
+<span class="sd"> operation -- a distinction is made for important reasons.</span>
+
+<span class="sd"> A certification:</span>
+<span class="sd"> * is made on a key,</span>
+<span class="sd"> * can help to validate or invalidate the key owner&#39;s identity,</span>
+<span class="sd"> * can assign trust levels to the key (or to uids and/or subkeys that</span>
+<span class="sd"> the key contains),</span>
+<span class="sd"> * and can be used in absense of in-person fingerprint checking to try</span>
+<span class="sd"> to build a path (through keys whose fingerprints have been checked)</span>
+<span class="sd"> to the key, so that the identity of the key&#39;s owner can be more</span>
+<span class="sd"> reliable without having to actually physically meet in person.</span>
+
+<span class="sd"> A signature:</span>
+<span class="sd"> * is created for a file or other piece of data,</span>
+<span class="sd"> * can help to prove that the data hasn&#39;t been altered,</span>
+<span class="sd"> * and can help to prove that the data was sent by the person(s) in</span>
+<span class="sd"> possession of the private key that created the signature, and for</span>
+<span class="sd"> parsing portions of status messages from decryption operations.</span>
+
+<span class="sd"> There are probably other things unique to each that have been</span>
+<span class="sd"> scatterbrainedly omitted due to the programmer sitting still and staring</span>
+<span class="sd"> at GnuPG debugging logs for too long without snacks, but that is the gist</span>
+<span class="sd"> of it.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+
+ <span class="n">TRUST_UNDEFINED</span> <span class="o">=</span> <span class="mi">0</span>
+ <span class="n">TRUST_NEVER</span> <span class="o">=</span> <span class="mi">1</span>
+ <span class="n">TRUST_MARGINAL</span> <span class="o">=</span> <span class="mi">2</span>
+ <span class="n">TRUST_FULLY</span> <span class="o">=</span> <span class="mi">3</span>
+ <span class="n">TRUST_ULTIMATE</span> <span class="o">=</span> <span class="mi">4</span>
+
+ <span class="n">TRUST_LEVELS</span> <span class="o">=</span> <span class="p">{</span><span class="s">&quot;TRUST_UNDEFINED&quot;</span> <span class="p">:</span> <span class="n">TRUST_UNDEFINED</span><span class="p">,</span>
+ <span class="s">&quot;TRUST_NEVER&quot;</span> <span class="p">:</span> <span class="n">TRUST_NEVER</span><span class="p">,</span>
+ <span class="s">&quot;TRUST_MARGINAL&quot;</span> <span class="p">:</span> <span class="n">TRUST_MARGINAL</span><span class="p">,</span>
+ <span class="s">&quot;TRUST_FULLY&quot;</span> <span class="p">:</span> <span class="n">TRUST_FULLY</span><span class="p">,</span>
+ <span class="s">&quot;TRUST_ULTIMATE&quot;</span> <span class="p">:</span> <span class="n">TRUST_ULTIMATE</span><span class="p">,}</span>
+
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Create a parser for verification and certification commands.</span>
+
+<span class="sd"> :param gpg: An instance of :class:`gnupg.GPG`.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="c">#: True if the signature is valid, False otherwise.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="c">#: A string describing the status of the signature verification.</span>
+ <span class="c">#: Can be one of ``signature bad``, ``signature good``,</span>
+ <span class="c">#: ``signature valid``, ``signature error``, ``decryption failed``,</span>
+ <span class="c">#: ``no public key``, ``key exp``, or ``key rev``.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The fingerprint of the signing keyid.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The fingerprint of the corresponding public key, which may be</span>
+ <span class="c">#: different if the signature was created with a subkey.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">pubkey_fingerprint</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The keyid of the signing key.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key_id</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The id of the signature itself.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">signature_id</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The creation date of the signing key.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">creation_date</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The timestamp of the purported signature, if we are unable to parse</span>
+ <span class="c">#: and/or validate it.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">timestamp</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The timestamp for when the valid signature was created.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">sig_timestamp</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The userid of the signing key which was used to create the</span>
+ <span class="c">#: signature.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">username</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: When the signing key is due to expire.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">expire_timestamp</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: An integer 0-4 describing the trust level of the signature.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">trust_level</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The string corresponding to the ``trust_level`` number.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">trust_text</span> <span class="o">=</span> <span class="bp">None</span>
+
+ <span class="k">def</span> <span class="nf">__nonzero__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Override the determination for truthfulness evaluation.</span>
+
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if we have a valid signature, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">valid</span>
+ <span class="n">__bool__</span> <span class="o">=</span> <span class="n">__nonzero__</span>
+
+<div class="viewcode-block" id="Verify._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.Verify._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">TRUST_LEVELS</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">trust_text</span> <span class="o">=</span> <span class="n">key</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">trust_level</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">TRUST_LEVELS</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;RSA_OR_IDEA&quot;</span><span class="p">,</span> <span class="s">&quot;NODATA&quot;</span><span class="p">,</span> <span class="s">&quot;IMPORT_RES&quot;</span><span class="p">,</span> <span class="s">&quot;PLAINTEXT&quot;</span><span class="p">,</span>
+ <span class="s">&quot;PLAINTEXT_LENGTH&quot;</span><span class="p">,</span> <span class="s">&quot;POLICY_URL&quot;</span><span class="p">,</span> <span class="s">&quot;DECRYPTION_INFO&quot;</span><span class="p">,</span>
+ <span class="s">&quot;DECRYPTION_OKAY&quot;</span><span class="p">,</span> <span class="s">&quot;INV_SGNR&quot;</span><span class="p">):</span>
+ <span class="k">pass</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;BADSIG&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;signature bad&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">username</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;GOODSIG&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;signature good&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key_id</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">username</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;VALIDSIG&quot;</span><span class="p">:</span>
+ <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">,</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">creation_date</span><span class="p">,</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">sig_timestamp</span><span class="p">,</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">expire_timestamp</span><span class="p">)</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()[:</span><span class="mi">4</span><span class="p">]</span>
+ <span class="c"># may be different if signature is made with a subkey</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">pubkey_fingerprint</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;signature valid&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;SIG_ID&quot;</span><span class="p">:</span>
+ <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">signature_id</span><span class="p">,</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">creation_date</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">timestamp</span><span class="p">)</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;ERRSIG&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key_id</span><span class="p">,</span>
+ <span class="n">algo</span><span class="p">,</span> <span class="n">hash_algo</span><span class="p">,</span>
+ <span class="n">cls</span><span class="p">,</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">timestamp</span><span class="p">)</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()[:</span><span class="mi">5</span><span class="p">]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;signature error&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;DECRYPTION_FAILED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key_id</span> <span class="o">=</span> <span class="n">value</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;decryption failed&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;NO_PUBKEY&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key_id</span> <span class="o">=</span> <span class="n">value</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;no public key&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;KEYEXPIRED&quot;</span><span class="p">,</span> <span class="s">&quot;SIGEXPIRED&quot;</span><span class="p">):</span>
+ <span class="c"># these are useless in verify, since they are spit out for any</span>
+ <span class="c"># pub/subkeys on the key, not just the one doing the signing.</span>
+ <span class="c"># if we want to check for signatures with expired key,</span>
+ <span class="c"># the relevant flag is EXPKEYSIG.</span>
+ <span class="k">pass</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;EXPKEYSIG&quot;</span><span class="p">,</span> <span class="s">&quot;REVKEYSIG&quot;</span><span class="p">):</span>
+ <span class="c"># signed with expired or revoked key</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">valid</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key_id</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="p">((</span><span class="s">&#39;</span><span class="si">%s</span><span class="s"> </span><span class="si">%s</span><span class="s">&#39;</span><span class="p">)</span> <span class="o">%</span> <span class="p">(</span><span class="n">key</span><span class="p">[:</span><span class="mi">3</span><span class="p">],</span> <span class="n">key</span><span class="p">[</span><span class="mi">3</span><span class="p">:]))</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Unknown status message: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
+
+</div></div>
+<div class="viewcode-block" id="Crypt"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.Crypt">[docs]</a><span class="k">class</span> <span class="nc">Crypt</span><span class="p">(</span><span class="n">Verify</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parser for internal status messages from GnuPG for ``--encrypt``,</span>
+<span class="sd"> ``--decrypt``, and ``--decrypt-files``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="n">Verify</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">)</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="c">#: A string containing the encrypted or decrypted data.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+ <span class="c">#: True if the decryption/encryption process turned out okay.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">ok</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="c">#: A string describing the current processing status, or error, if one</span>
+ <span class="c">#: has occurred.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data_timestamp</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data_filename</span> <span class="o">=</span> <span class="bp">None</span>
+
+ <span class="k">def</span> <span class="nf">__nonzero__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ok</span><span class="p">:</span> <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="bp">False</span>
+ <span class="n">__bool__</span> <span class="o">=</span> <span class="n">__nonzero__</span>
+
+ <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;The str() method for a :class:`Crypt` object will automatically return the</span>
+<span class="sd"> decoded data string, which stores the encryped or decrypted data.</span>
+
+<span class="sd"> In other words, these two statements are equivalent:</span>
+
+<span class="sd"> &gt;&gt;&gt; assert decrypted.data == str(decrypted)</span>
+
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">decode</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span><span class="o">.</span><span class="n">_encoding</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span><span class="o">.</span><span class="n">_decode_errors</span><span class="p">)</span>
+
+<div class="viewcode-block" id="Crypt._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.Crypt._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;ENC_TO&quot;</span><span class="p">,</span> <span class="s">&quot;USERID_HINT&quot;</span><span class="p">,</span> <span class="s">&quot;GOODMDC&quot;</span><span class="p">,</span> <span class="s">&quot;END_DECRYPTION&quot;</span><span class="p">,</span>
+ <span class="s">&quot;BEGIN_SIGNING&quot;</span><span class="p">,</span> <span class="s">&quot;NO_SECKEY&quot;</span><span class="p">,</span> <span class="s">&quot;ERROR&quot;</span><span class="p">,</span> <span class="s">&quot;NODATA&quot;</span><span class="p">,</span>
+ <span class="s">&quot;CARDCTRL&quot;</span><span class="p">):</span>
+ <span class="c"># in the case of ERROR, this is because a more specific error</span>
+ <span class="c"># message will have come first</span>
+ <span class="k">pass</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&quot;NEED_PASSPHRASE&quot;</span><span class="p">,</span> <span class="s">&quot;BAD_PASSPHRASE&quot;</span><span class="p">,</span> <span class="s">&quot;GOOD_PASSPHRASE&quot;</span><span class="p">,</span>
+ <span class="s">&quot;MISSING_PASSPHRASE&quot;</span><span class="p">,</span> <span class="s">&quot;DECRYPTION_FAILED&quot;</span><span class="p">,</span>
+ <span class="s">&quot;KEY_NOT_CREATED&quot;</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">key</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&quot;_&quot;</span><span class="p">,</span> <span class="s">&quot; &quot;</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;NEED_TRUSTDB&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span><span class="o">.</span><span class="n">_create_trustdb</span><span class="p">()</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;NEED_PASSPHRASE_SYM&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;need symmetric passphrase&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;BEGIN_DECRYPTION&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;decryption incomplete&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;BEGIN_ENCRYPTION&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;encryption incomplete&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;DECRYPTION_OKAY&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;decryption ok&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">ok</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;END_ENCRYPTION&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;encryption ok&#39;</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">ok</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;INV_RECP&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;invalid recipient&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEYEXPIRED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;key expired&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;KEYREVOKED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;key revoked&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;SIG_CREATED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;sig created&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;SIGEXPIRED&quot;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="s">&#39;sig expired&#39;</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&quot;PLAINTEXT&quot;</span><span class="p">:</span>
+ <span class="n">fmt</span><span class="p">,</span> <span class="n">dts</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">dts</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data_timestamp</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_filename</span> <span class="o">=</span> <span class="n">dts</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data_timestamp</span> <span class="o">=</span> <span class="n">dts</span>
+ <span class="c">## GnuPG gives us a hex byte for an ascii char corresponding to</span>
+ <span class="c">## the data format of the resulting plaintext,</span>
+ <span class="c">## i.e. &#39;62&#39;→&#39;b&#39;:= binary data</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">data_format</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">fmt</span><span class="p">),</span> <span class="mi">16</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="nb">super</span><span class="p">(</span><span class="n">Crypt</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">_handle_status</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
+</div></div>
+<div class="viewcode-block" id="ListPackets"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListPackets">[docs]</a><span class="k">class</span> <span class="nc">ListPackets</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Handle status messages for --list-packets.&quot;&quot;&quot;</span>
+
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">gpg</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">_gpg</span> <span class="o">=</span> <span class="n">gpg</span>
+ <span class="c">#: A string describing the current processing status, or error, if one</span>
+ <span class="c">#: has occurred.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: True if the passphrase to a public/private keypair is required.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">need_passphrase</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: True if a passphrase for a symmetric key is required.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">need_passphrase_sym</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="c">#: The keyid and uid which this data is encrypted to.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">userid_hint</span> <span class="o">=</span> <span class="bp">None</span>
+
+<div class="viewcode-block" id="ListPackets._handle_status"><a class="viewcode-back" href="../../gnupg.html#gnupg._parsers.ListPackets._handle_status">[docs]</a> <span class="k">def</span> <span class="nf">_handle_status</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Parse a status code from the attached GnuPG process.</span>
+
+<span class="sd"> :raises: :exc:`~exceptions.ValueError` if the status message is unknown.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&#39;NODATA&#39;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">status</span> <span class="o">=</span> <span class="n">nodata</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&#39;ENC_TO&#39;</span><span class="p">:</span>
+ <span class="c"># This will only capture keys in our keyring. In the future we</span>
+ <span class="c"># may want to include multiple unknown keys in this list.</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&#39;NEED_PASSPHRASE&#39;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">need_passphrase</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&#39;NEED_PASSPHRASE_SYM&#39;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">need_passphrase_sym</span> <span class="o">=</span> <span class="bp">True</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="o">==</span> <span class="s">&#39;USERID_HINT&#39;</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">userid_hint</span> <span class="o">=</span> <span class="n">value</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
+ <span class="k">elif</span> <span class="n">key</span> <span class="ow">in</span> <span class="p">(</span><span class="s">&#39;NO_SECKEY&#39;</span><span class="p">,</span> <span class="s">&#39;BEGIN_DECRYPTION&#39;</span><span class="p">,</span> <span class="s">&#39;DECRYPTION_FAILED&#39;</span><span class="p">,</span>
+ <span class="s">&#39;END_DECRYPTION&#39;</span><span class="p">):</span>
+ <span class="k">pass</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;Unknown status message: </span><span class="si">%r</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span></div></div>
+</pre></div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="../../search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="../../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../../genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/_modules/gnupg/_util.html b/docs/_build/html/_modules/gnupg/_util.html
new file mode 100644
index 0000000..b6968c4
--- /dev/null
+++ b/docs/_build/html/_modules/gnupg/_util.html
@@ -0,0 +1,718 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>gnupg._util &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="../../_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '../../',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="../../index.html" />
+ <link rel="up" title="gnupg" href="../gnupg.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="../../index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="../../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../../genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>Source code for gnupg._util</h1><div class="highlight"><pre>
+<span class="c"># -*- coding: utf-8 -*-</span>
+<span class="c">#</span>
+<span class="c"># This file is part of python-gnupg, a Python interface to GnuPG.</span>
+<span class="c"># Copyright © 2013 Isis Lovecruft, &lt;isis@leap.se&gt; 0xA3ADB67A2CDB8B35</span>
+<span class="c"># © 2013 Andrej B.</span>
+<span class="c"># © 2013 LEAP Encryption Access Project</span>
+<span class="c"># © 2008-2012 Vinay Sajip</span>
+<span class="c"># © 2005 Steve Traugott</span>
+<span class="c"># © 2004 A.M. Kuchling</span>
+<span class="c">#</span>
+<span class="c"># This program is free software: you can redistribute it and/or modify it</span>
+<span class="c"># under the terms of the GNU General Public License as published by the Free</span>
+<span class="c"># Software Foundation, either version 3 of the License, or (at your option)</span>
+<span class="c"># any later version.</span>
+<span class="c">#</span>
+<span class="c"># This program is distributed in the hope that it will be useful, but WITHOUT</span>
+<span class="c"># ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or</span>
+<span class="c"># FITNESS FOR A PARTICULAR PURPOSE. See the included LICENSE file for details.</span>
+
+<span class="sd">&#39;&#39;&#39;Extra utilities for python-gnupg.&#39;&#39;&#39;</span>
+
+<span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">absolute_import</span>
+<span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
+<span class="kn">from</span> <span class="nn">socket</span> <span class="kn">import</span> <span class="n">gethostname</span>
+<span class="kn">from</span> <span class="nn">time</span> <span class="kn">import</span> <span class="n">localtime</span>
+<span class="kn">from</span> <span class="nn">time</span> <span class="kn">import</span> <span class="n">mktime</span>
+
+<span class="kn">import</span> <span class="nn">codecs</span>
+<span class="kn">import</span> <span class="nn">encodings</span>
+<span class="kn">import</span> <span class="nn">os</span>
+<span class="kn">import</span> <span class="nn">psutil</span>
+<span class="kn">import</span> <span class="nn">threading</span>
+<span class="kn">import</span> <span class="nn">random</span>
+<span class="kn">import</span> <span class="nn">re</span>
+<span class="kn">import</span> <span class="nn">string</span>
+<span class="kn">import</span> <span class="nn">sys</span>
+
+<span class="k">try</span><span class="p">:</span>
+ <span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">StringIO</span>
+ <span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">BytesIO</span>
+<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
+ <span class="kn">from</span> <span class="nn">cStringIO</span> <span class="kn">import</span> <span class="n">StringIO</span>
+
+<span class="kn">from</span> <span class="nn">.</span> <span class="kn">import</span> <span class="n">_logger</span>
+
+
+<span class="k">try</span><span class="p">:</span>
+ <span class="nb">unicode</span>
+ <span class="n">_py3k</span> <span class="o">=</span> <span class="bp">False</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="nb">isinstance</span><span class="p">(</span><span class="n">__name__</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">NameError</span><span class="p">:</span>
+ <span class="n">msg</span> <span class="o">=</span> <span class="s">&quot;Sorry, python-gnupg requires a Python version with proper&quot;</span>
+ <span class="n">msg</span> <span class="o">+=</span> <span class="s">&quot; unicode support. Please upgrade to Python&gt;=2.6.&quot;</span>
+ <span class="k">raise</span> <span class="ne">SystemExit</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
+<span class="k">except</span> <span class="ne">NameError</span><span class="p">:</span>
+ <span class="n">_py3k</span> <span class="o">=</span> <span class="bp">True</span>
+
+
+<span class="c">## Directory shortcuts:</span>
+<span class="c">## we don&#39;t want to use this one because it writes to the install dir:</span>
+<span class="c">#_here = getabsfile(currentframe()).rsplit(os.path.sep, 1)[0]</span>
+<span class="n">_here</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">getcwd</span><span class="p">(),</span> <span class="s">&#39;gnupg&#39;</span><span class="p">)</span> <span class="c">## current dir</span>
+<span class="n">_test</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">_here</span><span class="p">,</span> <span class="s">&#39;test&#39;</span><span class="p">),</span> <span class="s">&#39;tmp&#39;</span><span class="p">)</span> <span class="c">## ./tests/tmp</span>
+<span class="n">_user</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;HOME&#39;</span><span class="p">)</span> <span class="c">## $HOME</span>
+<span class="n">_ugpg</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">_user</span><span class="p">,</span> <span class="s">&#39;.gnupg&#39;</span><span class="p">)</span> <span class="c">## $HOME/.gnupg</span>
+<span class="n">_conf</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">_user</span><span class="p">,</span> <span class="s">&#39;.config&#39;</span><span class="p">),</span> <span class="s">&#39;python-gnupg&#39;</span><span class="p">)</span>
+ <span class="c">## $HOME/.config/python-gnupg</span>
+
+<span class="c">## Logger is disabled by default</span>
+<span class="n">log</span> <span class="o">=</span> <span class="n">_logger</span><span class="o">.</span><span class="n">create_logger</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
+
+
+<div class="viewcode-block" id="find_encodings"><a class="viewcode-back" href="../../gnupg.html#gnupg._util.find_encodings">[docs]</a><span class="k">def</span> <span class="nf">find_encodings</span><span class="p">(</span><span class="n">enc</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">system</span><span class="o">=</span><span class="bp">False</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Find functions for encoding translations for a specific codec.</span>
+
+<span class="sd"> :param str enc: The codec to find translation functions for. It will be</span>
+<span class="sd"> normalized by converting to lowercase, excluding</span>
+<span class="sd"> everything which is not ascii, and hyphens will be</span>
+<span class="sd"> converted to underscores.</span>
+
+<span class="sd"> :param bool system: If True, find encodings based on the system&#39;s stdin</span>
+<span class="sd"> encoding, otherwise assume utf-8.</span>
+
+<span class="sd"> :raises: :exc:LookupError if the normalized codec, ``enc``, cannot be</span>
+<span class="sd"> found in Python&#39;s encoding translation map.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">enc</span><span class="p">:</span>
+ <span class="n">enc</span> <span class="o">=</span> <span class="s">&#39;utf-8&#39;</span>
+
+ <span class="k">if</span> <span class="n">system</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="p">,</span> <span class="s">&#39;encoding&#39;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="n">enc</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">encoding</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Obtained encoding from stdin: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">enc</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">enc</span> <span class="o">=</span> <span class="s">&#39;ascii&#39;</span>
+
+ <span class="c">## have to have lowercase to work, see</span>
+ <span class="c">## http://docs.python.org/dev/library/codecs.html#standard-encodings</span>
+ <span class="n">enc</span> <span class="o">=</span> <span class="n">enc</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
+ <span class="n">codec_alias</span> <span class="o">=</span> <span class="n">encodings</span><span class="o">.</span><span class="n">normalize_encoding</span><span class="p">(</span><span class="n">enc</span><span class="p">)</span>
+
+ <span class="n">codecs</span><span class="o">.</span><span class="n">register</span><span class="p">(</span><span class="n">encodings</span><span class="o">.</span><span class="n">search_function</span><span class="p">)</span>
+ <span class="n">coder</span> <span class="o">=</span> <span class="n">codecs</span><span class="o">.</span><span class="n">lookup</span><span class="p">(</span><span class="n">codec_alias</span><span class="p">)</span>
+
+ <span class="k">return</span> <span class="n">coder</span>
+</div>
+<div class="viewcode-block" id="author_info"><a class="viewcode-back" href="../../gnupg.html#gnupg._util.author_info">[docs]</a><span class="k">def</span> <span class="nf">author_info</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">contact</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">public_key</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Easy object-oriented representation of contributor info.</span>
+
+<span class="sd"> :param str name: The contributor´s name.</span>
+<span class="sd"> :param str contact: The contributor´s email address or contact</span>
+<span class="sd"> information, if given.</span>
+<span class="sd"> :param str public_key: The contributor´s public keyid, if given.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="n">Storage</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">contact</span><span class="o">=</span><span class="n">contact</span><span class="p">,</span> <span class="n">public_key</span><span class="o">=</span><span class="n">public_key</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_copy_data"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._copy_data">[docs]</a><span class="k">def</span> <span class="nf">_copy_data</span><span class="p">(</span><span class="n">instream</span><span class="p">,</span> <span class="n">outstream</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Copy data from one stream to another.</span>
+
+<span class="sd"> :type instream: :class:`io.BytesIO` or :class:`io.StringIO` or file</span>
+<span class="sd"> :param instream: A byte stream or open file to read from.</span>
+<span class="sd"> :param file outstream: The file descriptor of a tmpfile to write to.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">sent</span> <span class="o">=</span> <span class="mi">0</span>
+
+ <span class="n">coder</span> <span class="o">=</span> <span class="n">find_encodings</span><span class="p">()</span>
+
+ <span class="k">while</span> <span class="bp">True</span><span class="p">:</span>
+ <span class="k">if</span> <span class="p">((</span><span class="n">_py3k</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">instream</span><span class="p">,</span> <span class="nb">str</span><span class="p">))</span> <span class="ow">or</span>
+ <span class="p">(</span><span class="ow">not</span> <span class="n">_py3k</span> <span class="ow">and</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">instream</span><span class="p">,</span> <span class="nb">basestring</span><span class="p">))):</span>
+ <span class="n">data</span> <span class="o">=</span> <span class="n">instream</span><span class="p">[:</span><span class="mi">1024</span><span class="p">]</span>
+ <span class="n">instream</span> <span class="o">=</span> <span class="n">instream</span><span class="p">[</span><span class="mi">1024</span><span class="p">:]</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">data</span> <span class="o">=</span> <span class="n">instream</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="mi">1024</span><span class="p">)</span>
+ <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
+ <span class="k">break</span>
+ <span class="n">sent</span> <span class="o">+=</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Sending chunk </span><span class="si">%d</span><span class="s"> bytes:</span><span class="se">\n</span><span class="si">%s</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="p">(</span><span class="n">sent</span><span class="p">,</span> <span class="n">data</span><span class="p">))</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">outstream</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">UnicodeError</span><span class="p">:</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">outstream</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">coder</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
+ <span class="k">except</span> <span class="ne">IOError</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="s">&quot;Error sending data: Broken pipe&quot;</span><span class="p">)</span>
+ <span class="k">break</span>
+ <span class="k">except</span> <span class="ne">IOError</span> <span class="k">as</span> <span class="n">ioe</span><span class="p">:</span>
+ <span class="c"># Can get &#39;broken pipe&#39; errors even when all data was sent</span>
+ <span class="k">if</span> <span class="s">&#39;Broken pipe&#39;</span> <span class="ow">in</span> <span class="nb">str</span><span class="p">(</span><span class="n">ioe</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&#39;Error sending data: Broken pipe&#39;</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="n">ioe</span><span class="p">)</span>
+ <span class="k">break</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">outstream</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
+ <span class="k">except</span> <span class="ne">IOError</span> <span class="k">as</span> <span class="n">ioe</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;Unable to close outstream </span><span class="si">%s</span><span class="s">:</span><span class="se">\r\t</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">outstream</span><span class="p">,</span> <span class="n">ioe</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Closed outstream: </span><span class="si">%d</span><span class="s"> bytes sent.&quot;</span> <span class="o">%</span> <span class="n">sent</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_create_if_necessary"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._create_if_necessary">[docs]</a><span class="k">def</span> <span class="nf">_create_if_necessary</span><span class="p">(</span><span class="n">directory</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Create the specified directory, if necessary.</span>
+
+<span class="sd"> :param str directory: The directory to use.</span>
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if no errors occurred and the directory was created or</span>
+<span class="sd"> existed beforehand, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isabs</span><span class="p">(</span><span class="n">directory</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got non-absolute path: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+ <span class="n">directory</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">abspath</span><span class="p">(</span><span class="n">directory</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="n">directory</span><span class="p">):</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Creating directory: </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">directory</span><span class="p">)</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">makedirs</span><span class="p">(</span><span class="n">directory</span><span class="p">,</span> <span class="mh">0x1C0</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">ose</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">ose</span><span class="p">,</span> <span class="n">exc_info</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
+ <span class="k">return</span> <span class="bp">False</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Created directory.&quot;</span><span class="p">)</span>
+ <span class="k">return</span> <span class="bp">True</span>
+</div>
+<div class="viewcode-block" id="create_uid_email"><a class="viewcode-back" href="../../gnupg.html#gnupg._util.create_uid_email">[docs]</a><span class="k">def</span> <span class="nf">create_uid_email</span><span class="p">(</span><span class="n">username</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">hostname</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Create an email address suitable for a UID on a GnuPG key.</span>
+
+<span class="sd"> :param str username: The username portion of an email address. If None,</span>
+<span class="sd"> defaults to the username of the running Python</span>
+<span class="sd"> process.</span>
+
+<span class="sd"> :param str hostname: The FQDN portion of an email address. If None, the</span>
+<span class="sd"> hostname is obtained from gethostname(2).</span>
+
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: A string formatted as &lt;username&gt;@&lt;hostname&gt;.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="n">hostname</span><span class="p">:</span>
+ <span class="n">hostname</span> <span class="o">=</span> <span class="n">hostname</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="s">&#39;_&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">username</span><span class="p">:</span>
+ <span class="k">try</span><span class="p">:</span> <span class="n">username</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&#39;LOGNAME&#39;</span><span class="p">]</span>
+ <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> <span class="n">username</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&#39;USERNAME&#39;</span><span class="p">]</span>
+
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">hostname</span><span class="p">:</span> <span class="n">hostname</span> <span class="o">=</span> <span class="n">gethostname</span><span class="p">()</span>
+
+ <span class="n">uid</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">@</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">username</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="s">&#39;_&#39;</span><span class="p">),</span> <span class="n">hostname</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">username</span> <span class="o">=</span> <span class="n">username</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="s">&#39;_&#39;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="n">hostname</span><span class="p">)</span> <span class="ow">and</span> <span class="p">(</span><span class="n">username</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s">&#39;@&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">):</span>
+ <span class="n">uid</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">@</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">gethostname</span><span class="p">())</span>
+ <span class="k">elif</span> <span class="n">hostname</span><span class="p">:</span>
+ <span class="n">uid</span> <span class="o">=</span> <span class="s">&quot;</span><span class="si">%s</span><span class="s">@</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">username</span><span class="p">,</span> <span class="n">hostname</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">uid</span> <span class="o">=</span> <span class="n">username</span>
+
+ <span class="k">return</span> <span class="n">uid</span>
+</div>
+<div class="viewcode-block" id="_deprefix"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._deprefix">[docs]</a><span class="k">def</span> <span class="nf">_deprefix</span><span class="p">(</span><span class="n">line</span><span class="p">,</span> <span class="n">prefix</span><span class="p">,</span> <span class="n">callback</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Remove the prefix string from the beginning of line, if it exists.</span>
+
+<span class="sd"> :param string line: A line, such as one output by GnuPG&#39;s status-fd.</span>
+<span class="sd"> :param string prefix: A substring to remove from the beginning of</span>
+<span class="sd"> ``line``. Case insensitive.</span>
+<span class="sd"> :type callback: callable</span>
+<span class="sd"> :param callback: Function to call if the prefix is found. The signature to</span>
+<span class="sd"> callback will be only one argument, the ``line`` without the ``prefix``, i.e.</span>
+<span class="sd"> ``callback(line)``.</span>
+<span class="sd"> :rtype: string</span>
+<span class="sd"> :returns: If the prefix was found, the ``line`` without the prefix is</span>
+<span class="sd"> returned. Otherwise, the original ``line`` is returned.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="n">line</span><span class="o">.</span><span class="n">upper</span><span class="p">()</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s">u&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">prefix</span><span class="p">)</span><span class="o">.</span><span class="n">upper</span><span class="p">())</span>
+ <span class="k">except</span> <span class="ne">AssertionError</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Line doesn&#39;t start with prefix &#39;</span><span class="si">%s</span><span class="s">&#39;:</span><span class="se">\n</span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">prefix</span><span class="p">,</span> <span class="n">line</span><span class="p">))</span>
+ <span class="k">return</span> <span class="n">line</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="n">newline</span> <span class="o">=</span> <span class="n">line</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">prefix</span><span class="p">):]</span>
+ <span class="k">if</span> <span class="n">callback</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">callback</span><span class="p">(</span><span class="n">newline</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">exc</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">exception</span><span class="p">(</span><span class="n">exc</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">newline</span>
+</div>
+<div class="viewcode-block" id="_find_binary"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._find_binary">[docs]</a><span class="k">def</span> <span class="nf">_find_binary</span><span class="p">(</span><span class="n">binary</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Find the absolute path to the GnuPG binary.</span>
+
+<span class="sd"> Also run checks that the binary is not a symlink, and check that</span>
+<span class="sd"> our process real uid has exec permissions.</span>
+
+<span class="sd"> :param str binary: The path to the GnuPG binary.</span>
+<span class="sd"> :raises: :exc:`~exceptions.RuntimeError` if it appears that GnuPG is not</span>
+<span class="sd"> installed.</span>
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: The absolute path to the GnuPG binary to use, if no exceptions</span>
+<span class="sd"> occur.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">found</span> <span class="o">=</span> <span class="bp">None</span>
+ <span class="k">if</span> <span class="n">binary</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isabs</span><span class="p">(</span><span class="n">binary</span><span class="p">):</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">found</span> <span class="o">=</span> <span class="n">_which</span><span class="p">(</span><span class="n">binary</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Found potential binary paths: </span><span class="si">%s</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="s">&#39;</span><span class="se">\n</span><span class="s">&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="n">path</span> <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="n">found</span><span class="p">]))</span>
+ <span class="n">found</span> <span class="o">=</span> <span class="n">found</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="k">except</span> <span class="ne">IndexError</span> <span class="k">as</span> <span class="n">ie</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;Could not determine absolute path of binary: &#39;</span><span class="si">%s</span><span class="s">&#39;&quot;</span>
+ <span class="o">%</span> <span class="n">binary</span><span class="p">)</span>
+ <span class="k">elif</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">binary</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">X_OK</span><span class="p">):</span>
+ <span class="n">found</span> <span class="o">=</span> <span class="n">binary</span>
+ <span class="k">if</span> <span class="n">found</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">try</span><span class="p">:</span> <span class="n">found</span> <span class="o">=</span> <span class="n">_which</span><span class="p">(</span><span class="s">&#39;gpg&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="k">except</span> <span class="ne">IndexError</span> <span class="k">as</span> <span class="n">ie</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;Could not find binary for &#39;gpg&#39;.&quot;</span><span class="p">)</span>
+ <span class="k">try</span><span class="p">:</span> <span class="n">found</span> <span class="o">=</span> <span class="n">_which</span><span class="p">(</span><span class="s">&#39;gpg2&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="k">except</span> <span class="ne">IndexError</span> <span class="k">as</span> <span class="n">ie</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="s">&quot;Could not find binary for &#39;gpg2&#39;.&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">found</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">RuntimeError</span><span class="p">(</span><span class="s">&quot;GnuPG is not installed!&quot;</span><span class="p">)</span>
+
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">assert</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isabs</span><span class="p">(</span><span class="n">found</span><span class="p">),</span> <span class="s">&quot;Path to gpg binary not absolute&quot;</span>
+ <span class="k">assert</span> <span class="ow">not</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">islink</span><span class="p">(</span><span class="n">found</span><span class="p">),</span> <span class="s">&quot;Path to gpg binary is symlink&quot;</span>
+ <span class="k">assert</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">found</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">X_OK</span><span class="p">),</span> <span class="s">&quot;Lacking +x perms for gpg binary&quot;</span>
+ <span class="k">except</span> <span class="p">(</span><span class="ne">AssertionError</span><span class="p">,</span> <span class="ne">AttributeError</span><span class="p">)</span> <span class="k">as</span> <span class="n">ae</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">ae</span><span class="p">))</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">return</span> <span class="n">found</span>
+</div>
+<div class="viewcode-block" id="_has_readwrite"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._has_readwrite">[docs]</a><span class="k">def</span> <span class="nf">_has_readwrite</span><span class="p">(</span><span class="n">path</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd"> Determine if the real uid/gid of the executing user has read and write</span>
+<span class="sd"> permissions for a directory or a file.</span>
+
+<span class="sd"> :param str path: The path to the directory or file to check permissions</span>
+<span class="sd"> for.</span>
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if real uid/gid has read+write permissions, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">path</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">R_OK</span> <span class="o">^</span> <span class="n">os</span><span class="o">.</span><span class="n">W_OK</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_is_file"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._is_file">[docs]</a><span class="k">def</span> <span class="nf">_is_file</span><span class="p">(</span><span class="n">filename</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that the size of the thing which is supposed to be a filename has</span>
+<span class="sd"> size greater than zero, without following symbolic links or using</span>
+<span class="sd"> :func:os.path.isfile.</span>
+
+<span class="sd"> :param filename: An object to check.</span>
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if **filename** is file-like, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">statinfo</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">lstat</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;lstat(</span><span class="si">%r</span><span class="s">) with type=</span><span class="si">%s</span><span class="s"> gave us </span><span class="si">%r</span><span class="s">&quot;</span>
+ <span class="o">%</span> <span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">filename</span><span class="p">),</span> <span class="nb">type</span><span class="p">(</span><span class="n">filename</span><span class="p">),</span> <span class="nb">repr</span><span class="p">(</span><span class="n">statinfo</span><span class="p">)))</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">statinfo</span><span class="o">.</span><span class="n">st_size</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">):</span>
+ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s">&quot;&#39;</span><span class="si">%s</span><span class="s">&#39; appears to be an empty file!&quot;</span> <span class="o">%</span> <span class="n">filename</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">OSError</span> <span class="k">as</span> <span class="n">oserr</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">oserr</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">filename</span> <span class="o">==</span> <span class="s">&#39;-&#39;</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Got &#39;-&#39; for filename, assuming sys.stdin...&quot;</span><span class="p">)</span>
+ <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">TypeError</span><span class="p">,</span> <span class="ne">IOError</span><span class="p">)</span> <span class="k">as</span> <span class="n">err</span><span class="p">:</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="bp">False</span>
+</div>
+<div class="viewcode-block" id="_is_stream"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._is_stream">[docs]</a><span class="k">def</span> <span class="nf">_is_stream</span><span class="p">(</span><span class="nb">input</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that the input is a byte stream.</span>
+
+<span class="sd"> :param input: An object provided for reading from or writing to.</span>
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if :param:input is a stream, False if otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">BytesIO</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">isinstance</span><span class="p">(</span><span class="nb">input</span><span class="p">,</span> <span class="n">StringIO</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_is_list_or_tuple"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._is_list_or_tuple">[docs]</a><span class="k">def</span> <span class="nf">_is_list_or_tuple</span><span class="p">(</span><span class="n">instance</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Check that ``instance`` is a list or tuple.</span>
+
+<span class="sd"> :param instance: The object to type check.</span>
+<span class="sd"> :rtype: bool</span>
+<span class="sd"> :returns: True if ``instance`` is a list or tuple, False otherwise.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">,))</span>
+</div>
+<div class="viewcode-block" id="_is_gpg1"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._is_gpg1">[docs]</a><span class="k">def</span> <span class="nf">_is_gpg1</span><span class="p">(</span><span class="n">version</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Returns True if using GnuPG version 1.x.</span>
+
+<span class="sd"> :param tuple version: A tuple of three integers indication major, minor,</span>
+<span class="sd"> and micro version numbers.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="p">(</span><span class="n">major</span><span class="p">,</span> <span class="n">minor</span><span class="p">,</span> <span class="n">micro</span><span class="p">)</span> <span class="o">=</span> <span class="n">_match_version_string</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">major</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="bp">False</span>
+</div>
+<div class="viewcode-block" id="_is_gpg2"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._is_gpg2">[docs]</a><span class="k">def</span> <span class="nf">_is_gpg2</span><span class="p">(</span><span class="n">version</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Returns True if using GnuPG version 2.x.</span>
+
+<span class="sd"> :param tuple version: A tuple of three integers indication major, minor,</span>
+<span class="sd"> and micro version numbers.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="p">(</span><span class="n">major</span><span class="p">,</span> <span class="n">minor</span><span class="p">,</span> <span class="n">micro</span><span class="p">)</span> <span class="o">=</span> <span class="n">_match_version_string</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">major</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">True</span>
+ <span class="k">return</span> <span class="bp">False</span>
+</div>
+<div class="viewcode-block" id="_make_binary_stream"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._make_binary_stream">[docs]</a><span class="k">def</span> <span class="nf">_make_binary_stream</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">encoding</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;</span>
+<span class="sd"> xxx fill me in</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">if</span> <span class="n">_py3k</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
+ <span class="n">s</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">encoding</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="nb">str</span><span class="p">:</span>
+ <span class="n">s</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">encoding</span><span class="p">)</span>
+ <span class="kn">from</span> <span class="nn">io</span> <span class="kn">import</span> <span class="n">BytesIO</span>
+ <span class="n">rv</span> <span class="o">=</span> <span class="n">BytesIO</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
+ <span class="n">rv</span> <span class="o">=</span> <span class="n">StringIO</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">rv</span>
+</div>
+<div class="viewcode-block" id="_make_passphrase"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._make_passphrase">[docs]</a><span class="k">def</span> <span class="nf">_make_passphrase</span><span class="p">(</span><span class="n">length</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">save</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="nb">file</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Create a passphrase and write it to a file that only the user can read.</span>
+
+<span class="sd"> This is not very secure, and should not be relied upon for actual key</span>
+<span class="sd"> passphrases.</span>
+
+<span class="sd"> :param int length: The length in bytes of the string to generate.</span>
+
+<span class="sd"> :param file file: The file to save the generated passphrase in. If not</span>
+<span class="sd"> given, defaults to &#39;passphrase-&lt;the real user id&gt;-&lt;seconds since</span>
+<span class="sd"> epoch&gt;&#39; in the top-level directory.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">if</span> <span class="ow">not</span> <span class="n">length</span><span class="p">:</span>
+ <span class="n">length</span> <span class="o">=</span> <span class="mi">40</span>
+
+ <span class="n">passphrase</span> <span class="o">=</span> <span class="n">_make_random_string</span><span class="p">(</span><span class="n">length</span><span class="p">)</span>
+
+ <span class="k">if</span> <span class="n">save</span><span class="p">:</span>
+ <span class="n">ruid</span><span class="p">,</span> <span class="n">euid</span><span class="p">,</span> <span class="n">suid</span> <span class="o">=</span> <span class="n">psutil</span><span class="o">.</span><span class="n">Process</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">getpid</span><span class="p">())</span><span class="o">.</span><span class="n">uids</span>
+ <span class="n">gid</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">getgid</span><span class="p">()</span>
+ <span class="n">now</span> <span class="o">=</span> <span class="n">mktime</span><span class="p">(</span><span class="n">localtime</span><span class="p">())</span>
+
+ <span class="k">if</span> <span class="ow">not</span> <span class="nb">file</span><span class="p">:</span>
+ <span class="n">filename</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="s">&#39;passphrase-</span><span class="si">%s</span><span class="s">-</span><span class="si">%s</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">uid</span><span class="p">,</span> <span class="n">now</span><span class="p">)</span>
+ <span class="nb">file</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">_repo</span><span class="p">,</span> <span class="n">filename</span><span class="p">)</span>
+
+ <span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="s">&#39;a&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">fh</span><span class="p">:</span>
+ <span class="n">fh</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">passphrase</span><span class="p">)</span>
+ <span class="n">fh</span><span class="o">.</span><span class="n">flush</span><span class="p">()</span>
+ <span class="n">fh</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">chmod</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IRUSR</span> <span class="o">|</span> <span class="n">stat</span><span class="o">.</span><span class="n">S_IWUSR</span><span class="p">)</span>
+ <span class="n">os</span><span class="o">.</span><span class="n">chown</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">ruid</span><span class="p">,</span> <span class="n">gid</span><span class="p">)</span>
+
+ <span class="n">log</span><span class="o">.</span><span class="n">warn</span><span class="p">(</span><span class="s">&quot;Generated passphrase saved to </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="nb">file</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">passphrase</span>
+</div>
+<div class="viewcode-block" id="_make_random_string"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._make_random_string">[docs]</a><span class="k">def</span> <span class="nf">_make_random_string</span><span class="p">(</span><span class="n">length</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Returns a random lowercase, uppercase, alphanumerical string.</span>
+
+<span class="sd"> :param int length: The length in bytes of the string to generate.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">chars</span> <span class="o">=</span> <span class="n">string</span><span class="o">.</span><span class="n">ascii_lowercase</span> <span class="o">+</span> <span class="n">string</span><span class="o">.</span><span class="n">ascii_uppercase</span> <span class="o">+</span> <span class="n">string</span><span class="o">.</span><span class="n">digits</span>
+ <span class="k">return</span> <span class="s">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">random</span><span class="o">.</span><span class="n">choice</span><span class="p">(</span><span class="n">chars</span><span class="p">)</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">length</span><span class="p">))</span>
+</div>
+<div class="viewcode-block" id="_match_version_string"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._match_version_string">[docs]</a><span class="k">def</span> <span class="nf">_match_version_string</span><span class="p">(</span><span class="n">version</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Sort a binary version string into major, minor, and micro integers.</span>
+
+<span class="sd"> :param str version: A version string in the form x.x.x</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">regex</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">&#39;(\d)*(\.)*(\d)*(\.)*(\d)*&#39;</span><span class="p">)</span>
+ <span class="n">matched</span> <span class="o">=</span> <span class="n">regex</span><span class="o">.</span><span class="n">match</span><span class="p">(</span><span class="n">version</span><span class="p">)</span>
+ <span class="n">g</span> <span class="o">=</span> <span class="n">matched</span><span class="o">.</span><span class="n">groups</span><span class="p">()</span>
+ <span class="n">major</span><span class="p">,</span> <span class="n">minor</span><span class="p">,</span> <span class="n">micro</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">g</span><span class="p">[</span><span class="mi">0</span><span class="p">]),</span> <span class="nb">int</span><span class="p">(</span><span class="n">g</span><span class="p">[</span><span class="mi">2</span><span class="p">]),</span> <span class="nb">int</span><span class="p">(</span><span class="n">g</span><span class="p">[</span><span class="mi">4</span><span class="p">])</span>
+ <span class="k">return</span> <span class="p">(</span><span class="n">major</span><span class="p">,</span> <span class="n">minor</span><span class="p">,</span> <span class="n">micro</span><span class="p">)</span>
+</div>
+<div class="viewcode-block" id="_next_year"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._next_year">[docs]</a><span class="k">def</span> <span class="nf">_next_year</span><span class="p">():</span>
+ <span class="sd">&quot;&quot;&quot;Get the date of today plus one year.</span>
+
+<span class="sd"> :rtype: str</span>
+<span class="sd"> :returns: The date of this day next year, in the format &#39;%Y-%m-%d&#39;.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">now</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">__str__</span><span class="p">()</span>
+ <span class="n">date</span> <span class="o">=</span> <span class="n">now</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39; &#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
+ <span class="n">year</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="n">day</span> <span class="o">=</span> <span class="n">date</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s">&#39;-&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
+ <span class="n">next_year</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">year</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
+ <span class="k">return</span> <span class="s">&#39;-&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">((</span><span class="n">next_year</span><span class="p">,</span> <span class="n">month</span><span class="p">,</span> <span class="n">day</span><span class="p">))</span>
+</div>
+<div class="viewcode-block" id="_now"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._now">[docs]</a><span class="k">def</span> <span class="nf">_now</span><span class="p">():</span>
+ <span class="sd">&quot;&quot;&quot;Get a timestamp for right now, formatted according to ISO 8601.&quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="n">datetime</span><span class="o">.</span><span class="n">isoformat</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">())</span>
+</div>
+<div class="viewcode-block" id="_separate_keyword"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._separate_keyword">[docs]</a><span class="k">def</span> <span class="nf">_separate_keyword</span><span class="p">(</span><span class="n">line</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Split the line, and return (first_word, the_rest).&quot;&quot;&quot;</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="n">first</span><span class="p">,</span> <span class="n">rest</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
+ <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
+ <span class="n">first</span> <span class="o">=</span> <span class="n">line</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
+ <span class="n">rest</span> <span class="o">=</span> <span class="s">&#39;&#39;</span>
+ <span class="k">return</span> <span class="n">first</span><span class="p">,</span> <span class="n">rest</span>
+</div>
+<div class="viewcode-block" id="_threaded_copy_data"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._threaded_copy_data">[docs]</a><span class="k">def</span> <span class="nf">_threaded_copy_data</span><span class="p">(</span><span class="n">instream</span><span class="p">,</span> <span class="n">outstream</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Copy data from one stream to another in a separate thread.</span>
+
+<span class="sd"> Wraps ``_copy_data()`` in a :class:`threading.Thread`.</span>
+
+<span class="sd"> :type instream: :class:`io.BytesIO` or :class:`io.StringIO`</span>
+<span class="sd"> :param instream: A byte stream to read from.</span>
+<span class="sd"> :param file outstream: The file descriptor of a tmpfile to write to.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">copy_thread</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">_copy_data</span><span class="p">,</span>
+ <span class="n">args</span><span class="o">=</span><span class="p">(</span><span class="n">instream</span><span class="p">,</span> <span class="n">outstream</span><span class="p">))</span>
+ <span class="n">copy_thread</span><span class="o">.</span><span class="n">setDaemon</span><span class="p">(</span><span class="bp">True</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&#39;</span><span class="si">%r</span><span class="s">, </span><span class="si">%r</span><span class="s">, </span><span class="si">%r</span><span class="s">&#39;</span><span class="p">,</span> <span class="n">copy_thread</span><span class="p">,</span> <span class="n">instream</span><span class="p">,</span> <span class="n">outstream</span><span class="p">)</span>
+ <span class="n">copy_thread</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
+ <span class="k">return</span> <span class="n">copy_thread</span>
+</div>
+<div class="viewcode-block" id="_utc_epoch"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._utc_epoch">[docs]</a><span class="k">def</span> <span class="nf">_utc_epoch</span><span class="p">():</span>
+ <span class="sd">&quot;&quot;&quot;Get the seconds since epoch.&quot;&quot;&quot;</span>
+ <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">mktime</span><span class="p">(</span><span class="n">localtime</span><span class="p">()))</span>
+</div>
+<div class="viewcode-block" id="_which"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._which">[docs]</a><span class="k">def</span> <span class="nf">_which</span><span class="p">(</span><span class="n">executable</span><span class="p">,</span> <span class="n">flags</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">X_OK</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Borrowed from Twisted&#39;s :mod:twisted.python.proutils .</span>
+
+<span class="sd"> Search PATH for executable files with the given name.</span>
+
+<span class="sd"> On newer versions of MS-Windows, the PATHEXT environment variable will be</span>
+<span class="sd"> set to the list of file extensions for files considered executable. This</span>
+<span class="sd"> will normally include things like &quot;.EXE&quot;. This fuction will also find files</span>
+<span class="sd"> with the given name ending with any of these extensions.</span>
+
+<span class="sd"> On MS-Windows the only flag that has any meaning is os.F_OK. Any other</span>
+<span class="sd"> flags will be ignored.</span>
+
+<span class="sd"> Note: This function does not help us prevent an attacker who can already</span>
+<span class="sd"> manipulate the environment&#39;s PATH settings from placing malicious code</span>
+<span class="sd"> higher in the PATH. It also does happily follows links.</span>
+
+<span class="sd"> :param str name: The name for which to search.</span>
+<span class="sd"> :param int flags: Arguments to L{os.access}.</span>
+<span class="sd"> :rtype: list</span>
+<span class="sd"> :returns: A list of the full paths to files found, in the order in which</span>
+<span class="sd"> they were found.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">result</span> <span class="o">=</span> <span class="p">[]</span>
+ <span class="n">exts</span> <span class="o">=</span> <span class="nb">filter</span><span class="p">(</span><span class="bp">None</span><span class="p">,</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;PATHEXT&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">pathsep</span><span class="p">))</span>
+ <span class="n">path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;PATH&#39;</span><span class="p">,</span> <span class="bp">None</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">path</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">return</span> <span class="p">[]</span>
+ <span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&#39;PATH&#39;</span><span class="p">,</span> <span class="s">&#39;&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">pathsep</span><span class="p">):</span>
+ <span class="n">p</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">executable</span><span class="p">)</span>
+ <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">flags</span><span class="p">):</span>
+ <span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">p</span><span class="p">)</span>
+ <span class="k">for</span> <span class="n">e</span> <span class="ow">in</span> <span class="n">exts</span><span class="p">:</span>
+ <span class="n">pext</span> <span class="o">=</span> <span class="n">p</span> <span class="o">+</span> <span class="n">e</span>
+ <span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">pext</span><span class="p">,</span> <span class="n">flags</span><span class="p">):</span>
+ <span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">pext</span><span class="p">)</span>
+ <span class="k">return</span> <span class="n">result</span>
+</div>
+<div class="viewcode-block" id="_write_passphrase"><a class="viewcode-back" href="../../gnupg.html#gnupg._util._write_passphrase">[docs]</a><span class="k">def</span> <span class="nf">_write_passphrase</span><span class="p">(</span><span class="n">stream</span><span class="p">,</span> <span class="n">passphrase</span><span class="p">,</span> <span class="n">encoding</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Write the passphrase from memory to the GnuPG process&#39; stdin.</span>
+
+<span class="sd"> :type stream: file, :class:`~io.BytesIO`, or :class:`~io.StringIO`</span>
+<span class="sd"> :param stream: The input file descriptor to write the password to.</span>
+<span class="sd"> :param str passphrase: The passphrase for the secret key material.</span>
+<span class="sd"> :param str encoding: The data encoding expected by GnuPG. Usually, this</span>
+<span class="sd"> is ``sys.getfilesystemencoding()``.</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="n">passphrase</span> <span class="o">=</span> <span class="s">&#39;</span><span class="si">%s</span><span class="se">\n</span><span class="s">&#39;</span> <span class="o">%</span> <span class="n">passphrase</span>
+ <span class="n">passphrase</span> <span class="o">=</span> <span class="n">passphrase</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="n">encoding</span><span class="p">)</span>
+ <span class="n">stream</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">passphrase</span><span class="p">)</span>
+ <span class="n">log</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Wrote passphrase on stdin.&quot;</span><span class="p">)</span>
+
+</div>
+<div class="viewcode-block" id="InheritableProperty"><a class="viewcode-back" href="../../gnupg.html#gnupg._util.InheritableProperty">[docs]</a><span class="k">class</span> <span class="nc">InheritableProperty</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;Based on the emulation of PyProperty_Type() in Objects/descrobject.c&quot;&quot;&quot;</span>
+
+ <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fget</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">fset</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">fdel</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fget</span> <span class="o">=</span> <span class="n">fget</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fset</span> <span class="o">=</span> <span class="n">fset</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fdel</span> <span class="o">=</span> <span class="n">fdel</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">__doc__</span> <span class="o">=</span> <span class="n">doc</span>
+
+ <span class="k">def</span> <span class="nf">__get__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">,</span> <span class="n">objtype</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
+ <span class="k">if</span> <span class="n">obj</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">self</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fget</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span><span class="s">&quot;unreadable attribute&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fget</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;&lt;lambda&gt;&#39;</span> <span class="ow">or</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">fget</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">fget</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fget</span><span class="o">.</span><span class="n">__name__</span><span class="p">)()</span>
+
+ <span class="k">def</span> <span class="nf">__set__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fset</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span><span class="s">&quot;can&#39;t set attribute&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fset</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;&lt;lambda&gt;&#39;</span> <span class="ow">or</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">fset</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fset</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="nb">getattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fset</span><span class="o">.</span><span class="n">__name__</span><span class="p">)(</span><span class="n">value</span><span class="p">)</span>
+
+ <span class="k">def</span> <span class="nf">__delete__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fdel</span> <span class="ow">is</span> <span class="bp">None</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span><span class="s">&quot;can&#39;t delete attribute&quot;</span><span class="p">)</span>
+ <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">fdel</span><span class="o">.</span><span class="n">__name__</span> <span class="o">==</span> <span class="s">&#39;&lt;lambda&gt;&#39;</span> <span class="ow">or</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">fdel</span><span class="o">.</span><span class="n">__name__</span><span class="p">:</span>
+ <span class="bp">self</span><span class="o">.</span><span class="n">fdel</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
+ <span class="k">else</span><span class="p">:</span>
+ <span class="nb">getattr</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fdel</span><span class="o">.</span><span class="n">__name__</span><span class="p">)()</span>
+
+</div>
+<div class="viewcode-block" id="Storage"><a class="viewcode-back" href="../../gnupg.html#gnupg._util.Storage">[docs]</a><span class="k">class</span> <span class="nc">Storage</span><span class="p">(</span><span class="nb">dict</span><span class="p">):</span>
+ <span class="sd">&quot;&quot;&quot;A dictionary where keys are stored as class attributes.</span>
+
+<span class="sd"> For example, ``obj.foo`` can be used in addition to ``obj[&#39;foo&#39;]``:</span>
+
+<span class="sd"> &gt;&gt;&gt; o = Storage(a=1)</span>
+<span class="sd"> &gt;&gt;&gt; o.a</span>
+<span class="sd"> 1</span>
+<span class="sd"> &gt;&gt;&gt; o[&#39;a&#39;]</span>
+<span class="sd"> 1</span>
+<span class="sd"> &gt;&gt;&gt; o.a = 2</span>
+<span class="sd"> &gt;&gt;&gt; o[&#39;a&#39;]</span>
+<span class="sd"> 2</span>
+<span class="sd"> &gt;&gt;&gt; del o.a</span>
+<span class="sd"> &gt;&gt;&gt; o.a</span>
+<span class="sd"> None</span>
+<span class="sd"> &quot;&quot;&quot;</span>
+ <span class="k">def</span> <span class="nf">__getattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">self</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
+ <span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">k</span><span class="p">:</span>
+ <span class="k">return</span> <span class="bp">None</span>
+
+ <span class="k">def</span> <span class="nf">__setattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="bp">self</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
+
+ <span class="k">def</span> <span class="nf">__delattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
+ <span class="k">try</span><span class="p">:</span>
+ <span class="k">del</span> <span class="bp">self</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
+ <span class="k">except</span> <span class="ne">KeyError</span> <span class="k">as</span> <span class="n">k</span><span class="p">:</span>
+ <span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span><span class="n">k</span><span class="o">.</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
+
+ <span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">return</span> <span class="s">&#39;&lt;Storage &#39;</span> <span class="o">+</span> <span class="nb">dict</span><span class="o">.</span><span class="n">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">+</span> <span class="s">&#39;&gt;&#39;</span>
+
+ <span class="k">def</span> <span class="nf">__getstate__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
+ <span class="k">return</span> <span class="nb">dict</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
+
+ <span class="k">def</span> <span class="nf">__setstate__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
+ <span class="k">for</span> <span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span> <span class="ow">in</span> <span class="n">value</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
+ <span class="bp">self</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">v</span></div>
+</pre></div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="../../search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="../../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../../genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/_modules/index.html b/docs/_build/html/_modules/index.html
new file mode 100644
index 0000000..d032746
--- /dev/null
+++ b/docs/_build/html/_modules/index.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>Overview: module code &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '../',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="../index.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="../index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1>All modules for which code is available</h1>
+<ul><li><a href="gnupg.html">gnupg</a></li>
+<ul><li><a href="gnupg/_meta.html">gnupg._meta</a></li>
+<li><a href="gnupg/_parsers.html">gnupg._parsers</a></li>
+<li><a href="gnupg/_util.html">gnupg._util</a></li>
+</ul></ul>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="../search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="../py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="../genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/_sources/gnupg.txt b/docs/_build/html/_sources/gnupg.txt
new file mode 100644
index 0000000..fc8a479
--- /dev/null
+++ b/docs/_build/html/_sources/gnupg.txt
@@ -0,0 +1,131 @@
+gnupg package
+=============
+
+gnupg module
+------------
+
+This module contains public classes for working with GnuPG_. To get started,
+do:
+
+>>> import gnupg
+>>> gpg = gnupg.GPG()
+
+
+.. automodule:: gnupg
+ :members:
+ :undoc-members:
+ :private-members:
+ :show-inheritance:
+
+.. _meta:
+
+meta module
+-----------
+
+Contains the meta and base classes which :class:`gnupg.GPG` inherits
+from. Mostly, you shouldn't ever need to touch anything in here, unless you're
+doing some serious hacking.
+
+
+.. automodule:: gnupg._meta
+ :members:
+ :private-members:
+ :special-members:
+ :exclude-members: _agent_proc, __module__, __dict__, _decode_errors, init,
+ __weakref__, _result_map, __metaclass__
+ :show-inheritance:
+
+.. _parsers:
+
+parsers module
+--------------
+
+These are classes for parsing both user inputs and status file descriptor
+flags from GnuPG's output. The latter are used in order to determine what our
+GnuPG process is doing and retrieve information about its operations, which
+are stored in corresponding classes in
+:attr:`~gnupg._meta.GPGBase._result_map`. Some status flags aren't handled yet
+-- information on *all* of the flags (well, at least the documented ones…) can
+be found in the :file:`docs/DETAILS` file in GnuPG's source_, which has been
+included here_ as well.
+
+
+.. automodule:: gnupg._parsers
+ :members:
+ :undoc-members:
+ :private-members:
+ :show-inheritance:
+
+
+.. _util:
+
+util module
+-----------
+
+You shouldn't really need to mess with this module either, it mostly deals
+with low-level IO and file handling operations, de-/en- coding issues, and
+setting up basic package facilities such as logging.
+
+.. automodule:: gnupg._util
+ :members:
+ :undoc-members:
+ :private-members:
+ :show-inheritance:
+
+
+About this fork
+---------------
+
+This is a modified version of python-gnupg_, (forked from version 0.3.2) which
+was created by Vinay Sajip, which itself is a modification of GPG.py written
+by Steve Traugott, which in turn is a modification of the pycrypto GnuPG
+interface written by A.M. Kuchling.
+
+This version is patched to sanitize untrusted inputs, due to the necessity of
+executing ``subprocess.Popen([...], shell=True)`` in order to communicate with
+GnuPG. Several speed improvements were also made based on code profiling, and
+the API has been cleaned up to support an easier, more Pythonic, interaction.
+
+
+Previous Authors' Documentation
+-------------------------------
+
+Steve Traugott's documentation:
+ |
+ | Portions of this module are derived from A.M. Kuchling's well-designed
+ | GPG.py, using Richard Jones' updated version 1.3, which can be found in
+ | the pycrypto CVS repository on Sourceforge:
+ |
+ | http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py
+ |
+ | This module is *not* forward-compatible with amk's; some of the old
+ | interface has changed. For instance, since I've added decrypt
+ | functionality, I elected to initialize with a 'gpghome' argument instead
+ | of 'keyring', so that gpg can find both the public and secret keyrings.
+ | I've also altered some of the returned objects in order for the caller to
+ | not have to know as much about the internals of the result classes.
+ |
+ | While the rest of ISconf is released under the GPL, I am releasing this
+ | single file under the same terms that A.M. Kuchling used for pycrypto.
+ |
+ | Steve Traugott, stevegt@terraluna.org
+ | Thu Jun 23 21:27:20 PDT 2005
+
+
+Vinay Sajip's documentation:
+ |
+ | This version of the module has been modified from Steve Traugott's version
+ | (see http://trac.t7a.org/isconf/browser/trunk/lib/python/isconf/GPG.py) by
+ | Vinay Sajip to make use of the subprocess module (Steve's version uses
+ | os.fork() and so does not work on Windows). Renamed to gnupg.py to avoid
+ | confusion with the previous versions.
+ |
+ | A unittest harness (test_gnupg.py) has also been added.
+ |
+ | Modifications Copyright (C) 2008-2012 Vinay Sajip. All rights reserved.
+
+
+.. _GnuPG: http://gnupg.org
+.. _python-gnupg: https://code.google.com/p/python-gnupg/
+.. _source: http://http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=shortlog;h=refs/heads/master
+.. _here: ./_static/DETAILS.html
diff --git a/docs/_build/html/_sources/index.txt b/docs/_build/html/_sources/index.txt
new file mode 100644
index 0000000..c266353
--- /dev/null
+++ b/docs/_build/html/_sources/index.txt
@@ -0,0 +1,44 @@
+.. gnupg documentation master file, created by
+ sphinx-quickstart on Fri Apr 5 22:38:47 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+gnupg: Python Package Documentation
+===================================
+A Python interface for handling interactions with GnuPG, including keyfile
+generation, keyring maintainance, import and export, encryption and
+decryption, sending to and recieving from keyservers, and signing and
+verification.
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ gnupg
+
+
+Source, license, & bug reports
+==============================
+The source code which was used to generate this documentation is accessible by
+clicking the little `source` links next to the docs. Current source code can
+be found in this github repository_. The **master** branch always reflects the
+latest release, all releases are tagged with signed, annotated git tags, and
+the **develop** branch represents the state of the next release.
+
+This package is released under GPLv3_ or greater.
+
+If you find a bug, or would like to request a feature, please use our public
+bugtracker_ on github. Patches warmly welcome.
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+.. _source: https://github.com/isislovecruft/python-gnupg
+.. _repository: https://github.com/isislovecruft/python-gnupg
+.. _GPLv3: https://www.gnu.org/licenses/gpl.txt
+.. _bugtracker: https://github.com/isislovecruft/python-gnupg/issues
diff --git a/docs/_build/html/_static/DETAILS.html b/docs/_build/html/_static/DETAILS.html
new file mode 100644
index 0000000..7b0b9f8
--- /dev/null
+++ b/docs/_build/html/_static/DETAILS.html
@@ -0,0 +1,2677 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>GnuPG Details</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
+<meta name="title" content="GnuPG Details"/>
+<meta name="generator" content="Org-mode"/>
+<meta name="generated" content="2013-07-03T09:52+0000"/>
+<meta name="author" content="isis"/>
+<meta name="description" content=""/>
+<meta name="keywords" content=""/>
+<style type="text/css">
+ <!--/*--><![CDATA[/*><!--*/
+ html { font-family: Times, serif; font-size: 12pt; }
+ .title { text-align: center; }
+ .todo { color: red; }
+ .done { color: green; }
+ .tag { background-color: #add8e6; font-weight:normal }
+ .target { }
+ .timestamp { color: #bebebe; }
+ .timestamp-kwd { color: #5f9ea0; }
+ .right {margin-left:auto; margin-right:0px; text-align:right;}
+ .left {margin-left:0px; margin-right:auto; text-align:left;}
+ .center {margin-left:auto; margin-right:auto; text-align:center;}
+ p.verse { margin-left: 3% }
+ pre {
+ border: 1pt solid #AEBDCC;
+ background-color: #F3F5F7;
+ padding: 5pt;
+ font-family: courier, monospace;
+ font-size: 90%;
+ overflow:auto;
+ }
+ table { border-collapse: collapse; }
+ td, th { vertical-align: top; }
+ th.right { text-align:center; }
+ th.left { text-align:center; }
+ th.center { text-align:center; }
+ td.right { text-align:right; }
+ td.left { text-align:left; }
+ td.center { text-align:center; }
+ dt { font-weight: bold; }
+ div.figure { padding: 0.5em; }
+ div.figure p { text-align: center; }
+ div.inlinetask {
+ padding:10px;
+ border:2px solid gray;
+ margin:10px;
+ background: #ffffcc;
+ }
+ textarea { overflow-x: auto; }
+ .linenr { font-size:smaller }
+ .code-highlighted {background-color:#ffff00;}
+ .org-info-js_info-navigation { border-style:none; }
+ #org-info-js_console-label { font-size:10px; font-weight:bold;
+ white-space:nowrap; }
+ .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
+ font-weight:bold; }
+ /*]]>*/-->
+</style>
+<script type="text/javascript">
+/*
+@licstart The following is the entire license notice for the
+JavaScript code in this tag.
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+
+The JavaScript code in this tag is free software: you can
+redistribute it and/or modify it under the terms of the GNU
+General Public License (GNU GPL) as published by the Free Software
+Foundation, either version 3 of the License, or (at your option)
+any later version. The code is distributed WITHOUT ANY WARRANTY;
+without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
+
+As additional permission under GNU GPL version 3 section 7, you
+may distribute non-source (e.g., minimized or compacted) forms of
+that code without the copy of the GNU GPL normally required by
+section 4, provided you include this license notice and a URL
+through which recipients can access the Corresponding Source.
+
+
+@licend The above is the entire license notice
+for the JavaScript code in this tag.
+*/
+<!--/*--><![CDATA[/*><!--*/
+ function CodeHighlightOn(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(null != target) {
+ elem.cacheClassElem = elem.className;
+ elem.cacheClassTarget = target.className;
+ target.className = "code-highlighted";
+ elem.className = "code-highlighted";
+ }
+ }
+ function CodeHighlightOff(elem, id)
+ {
+ var target = document.getElementById(id);
+ if(elem.cacheClassElem)
+ elem.className = elem.cacheClassElem;
+ if(elem.cacheClassTarget)
+ target.className = elem.cacheClassTarget;
+ }
+/*]]>*///-->
+</script>
+<script type="text/css" href="./agogo.css" />
+</head>
+<body>
+
+<div id="preamble">
+
+</div>
+
+<div id="content">
+<h1 class="title">GnuPG Details</h1>
+
+
+<p>
+This is the DETAILS file for GnuPG which specifies some internals and
+parts of the external API for GPG and GPGSM.
+</p>
+
+<div id="table-of-contents">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents">
+<ul>
+<li><a href="#sec-1">1 Format of the colon listings</a>
+<ul>
+<li><a href="#sec-1-1">1.1 Description of the fields</a>
+<ul>
+<li><a href="#sec-1-1-1">1.1.1 Field 1 - Type of record</a></li>
+<li><a href="#sec-1-1-2">1.1.2 Field 2 - Validity</a></li>
+<li><a href="#sec-1-1-3">1.1.3 Field 3 - Key length</a></li>
+<li><a href="#sec-1-1-4">1.1.4 Field 4 - Public key algorithm</a></li>
+<li><a href="#sec-1-1-5">1.1.5 Field 5 - KeyID</a></li>
+<li><a href="#sec-1-1-6">1.1.6 Field 6 - Creation date</a></li>
+<li><a href="#sec-1-1-7">1.1.7 Field 7 - Expiration date</a></li>
+<li><a href="#sec-1-1-8">1.1.8 Field 8 - Certificate S/N, UID hash, trust signature info</a></li>
+<li><a href="#sec-1-1-9">1.1.9 Field 9 - Ownertrust</a></li>
+<li><a href="#sec-1-1-10">1.1.10 Field 10 - User-ID</a></li>
+<li><a href="#sec-1-1-11">1.1.11 Field 11 - Signature class</a></li>
+<li><a href="#sec-1-1-12">1.1.12 Field 12 - Key capabilities</a></li>
+<li><a href="#sec-1-1-13">1.1.13 Field 13 - Issuer certificate fingerprint or other info</a></li>
+<li><a href="#sec-1-1-14">1.1.14 Field 14 - Flag field</a></li>
+<li><a href="#sec-1-1-15">1.1.15 Field 15 - S/N of a token</a></li>
+<li><a href="#sec-1-1-16">1.1.16 Field 16 - Hash algorithm</a></li>
+</ul>
+</li>
+<li><a href="#sec-1-2">1.2 Special fields</a>
+<ul>
+<li><a href="#sec-1-2-1">1.2.1 PKD - Public key data</a></li>
+<li><a href="#sec-1-2-2">1.2.2 TRU - Trust database information</a></li>
+<li><a href="#sec-1-2-3">1.2.3 SPK - Signature subpacket records</a></li>
+<li><a href="#sec-1-2-4">1.2.4 CFG - Configuration data</a></li>
+</ul></li>
+</ul>
+</li>
+<li><a href="#sec-2">2 Format of the &ndash;status-fd output</a>
+<ul>
+<li><a href="#sec-2-1">2.1 General status codes</a>
+<ul>
+<li><a href="#sec-2-1-1">2.1.1 NEWSIG</a></li>
+<li><a href="#sec-2-1-2">2.1.2 GOODSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</a></li>
+<li><a href="#sec-2-1-3">2.1.3 EXPSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</a></li>
+<li><a href="#sec-2-1-4">2.1.4 EXPKEYSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</a></li>
+<li><a href="#sec-2-1-5">2.1.5 REVKEYSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</a></li>
+<li><a href="#sec-2-1-6">2.1.6 BADSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</a></li>
+<li><a href="#sec-2-1-7">2.1.7 ERRSIG &lt;keyid&gt; &lt;pkalgo&gt; &lt;hashalgo&gt; &lt;sig_class&gt; &lt;time&gt; &lt;rc&gt;</a></li>
+<li><a href="#sec-2-1-8">2.1.8 VALIDSIG &lt;args&gt;</a></li>
+<li><a href="#sec-2-1-9">2.1.9 SIG_ID &lt;radix64_string&gt; &lt;sig_creation_date&gt; &lt;sig-timestamp&gt;</a></li>
+<li><a href="#sec-2-1-10">2.1.10 ENC_TO &lt;long_keyid&gt; &lt;keytype&gt; &lt;keylength&gt;</a></li>
+<li><a href="#sec-2-1-11">2.1.11 BEGIN_DECRYPTION</a></li>
+<li><a href="#sec-2-1-12">2.1.12 END_DECRYPTION</a></li>
+<li><a href="#sec-2-1-13">2.1.13 DECRYPTION_INFO &lt;mdc_method&gt; &lt;sym_algo&gt;</a></li>
+<li><a href="#sec-2-1-14">2.1.14 DECRYPTION_FAILED</a></li>
+<li><a href="#sec-2-1-15">2.1.15 DECRYPTION_OKAY</a></li>
+<li><a href="#sec-2-1-16">2.1.16 SESSION_KEY &lt;algo&gt;:&lt;hexdigits&gt;</a></li>
+<li><a href="#sec-2-1-17">2.1.17 BEGIN_ENCRYPTION &lt;mdc_method&gt; &lt;sym_algo&gt;</a></li>
+<li><a href="#sec-2-1-18">2.1.18 END_ENCRYPTION</a></li>
+<li><a href="#sec-2-1-19">2.1.19 FILE_START &lt;what&gt; &lt;filename&gt;</a></li>
+<li><a href="#sec-2-1-20">2.1.20 FILE_DONE</a></li>
+<li><a href="#sec-2-1-21">2.1.21 BEGIN_SIGNING</a></li>
+<li><a href="#sec-2-1-22">2.1.22 ALREADY_SIGNED &lt;long-keyid&gt;</a></li>
+<li><a href="#sec-2-1-23">2.1.23 SIG_CREATED &lt;type&gt; &lt;pk_algo&gt; &lt;hash_algo&gt; &lt;class&gt; &lt;timestamp&gt; &lt;keyfpr&gt;</a></li>
+<li><a href="#sec-2-1-24">2.1.24 NOTATION_</a></li>
+<li><a href="#sec-2-1-25">2.1.25 POLICY_URL &lt;string&gt;</a></li>
+<li><a href="#sec-2-1-26">2.1.26 PLAINTEXT &lt;format&gt; &lt;timestamp&gt; &lt;filename&gt;</a></li>
+<li><a href="#sec-2-1-27">2.1.27 PLAINTEXT_LENGTH &lt;length&gt;</a></li>
+<li><a href="#sec-2-1-28">2.1.28 ATTRIBUTE &lt;arguments&gt;</a></li>
+<li><a href="#sec-2-1-29">2.1.29 SIG_SUBPACKET &lt;type&gt; &lt;flags&gt; &lt;len&gt; &lt;data&gt;</a></li>
+</ul>
+</li>
+<li><a href="#sec-2-2">2.2 Key related</a>
+<ul>
+<li><a href="#sec-2-2-1">2.2.1 INV_RECP, INV_SGNR</a></li>
+<li><a href="#sec-2-2-2">2.2.2 NO_RECP &lt;reserved&gt;</a></li>
+<li><a href="#sec-2-2-3">2.2.3 NO_SGNR &lt;reserved&gt;</a></li>
+<li><a href="#sec-2-2-4">2.2.4 KEYEXPIRED &lt;expire-timestamp&gt;</a></li>
+<li><a href="#sec-2-2-5">2.2.5 KEYREVOKED</a></li>
+<li><a href="#sec-2-2-6">2.2.6 NO_PUBKEY &lt;long keyid&gt;</a></li>
+<li><a href="#sec-2-2-7">2.2.7 NO_SECKEY &lt;long keyid&gt;</a></li>
+<li><a href="#sec-2-2-8">2.2.8 KEY_CREATED &lt;type&gt; &lt;fingerprint&gt; [&lt;handle&gt;]</a></li>
+<li><a href="#sec-2-2-9">2.2.9 KEY_NOT_CREATED [&lt;handle&gt;]</a></li>
+<li><a href="#sec-2-2-10">2.2.10 TRUST_</a></li>
+<li><a href="#sec-2-2-11">2.2.11 PKA_TRUST_</a></li>
+</ul>
+</li>
+<li><a href="#sec-2-3">2.3 Remote control</a>
+<ul>
+<li><a href="#sec-2-3-1">2.3.1 GET_BOOL, GET_LINE, GET_HIDDEN, GOT_IT</a></li>
+<li><a href="#sec-2-3-2">2.3.2 USERID_HINT &lt;long main keyid&gt; &lt;string&gt;</a></li>
+<li><a href="#sec-2-3-3">2.3.3 NEED_PASSPHRASE &lt;long keyid&gt; &lt;long main keyid&gt; &lt;keytype&gt; &lt;keylength&gt;</a></li>
+<li><a href="#sec-2-3-4">2.3.4 NEED_PASSPHRASE_SYM &lt;cipher_algo&gt; &lt;s2k_mode&gt; &lt;s2k_hash&gt;</a></li>
+<li><a href="#sec-2-3-5">2.3.5 NEED_PASSPHRASE_PIN &lt;card_type&gt; &lt;chvno&gt; [&lt;serialno&gt;]</a></li>
+<li><a href="#sec-2-3-6">2.3.6 MISSING_PASSPHRASE</a></li>
+<li><a href="#sec-2-3-7">2.3.7 BAD_PASSPHRASE &lt;long keyid&gt;</a></li>
+<li><a href="#sec-2-3-8">2.3.8 GOOD_PASSPHRASE</a></li>
+</ul>
+</li>
+<li><a href="#sec-2-4">2.4 Import/Export</a>
+<ul>
+<li><a href="#sec-2-4-1">2.4.1 IMPORT_CHECK &lt;long keyid&gt; &lt;fingerprint&gt; &lt;user ID&gt;</a></li>
+<li><a href="#sec-2-4-2">2.4.2 IMPORTED &lt;long keyid&gt; &lt;username&gt;</a></li>
+<li><a href="#sec-2-4-3">2.4.3 IMPORT_OK &lt;reason&gt; [&lt;fingerprint&gt;]</a></li>
+<li><a href="#sec-2-4-4">2.4.4 IMPORT_PROBLEM &lt;reason&gt; [&lt;fingerprint&gt;]</a></li>
+<li><a href="#sec-2-4-5">2.4.5 IMPORT_RES &lt;args&gt;</a></li>
+</ul>
+</li>
+<li><a href="#sec-2-5">2.5 Smartcard related</a>
+<ul>
+<li><a href="#sec-2-5-1">2.5.1 CARDCTRL &lt;what&gt; [&lt;serialno&gt;]</a></li>
+<li><a href="#sec-2-5-2">2.5.2 SC_OP_FAILURE [&lt;code&gt;]</a></li>
+<li><a href="#sec-2-5-3">2.5.3 SC_OP_SUCCESS</a></li>
+</ul>
+</li>
+<li><a href="#sec-2-6">2.6 Miscellaneous status codes</a>
+<ul>
+<li><a href="#sec-2-6-1">2.6.1 NODATA &lt;what&gt;</a></li>
+<li><a href="#sec-2-6-2">2.6.2 UNEXPECTED &lt;what&gt;</a></li>
+<li><a href="#sec-2-6-3">2.6.3 TRUNCATED &lt;maxno&gt;</a></li>
+<li><a href="#sec-2-6-4">2.6.4 ERROR &lt;error location&gt; &lt;error code&gt; [&lt;more&gt;]</a></li>
+<li><a href="#sec-2-6-5">2.6.5 SUCCESS [&lt;location&gt;]</a></li>
+<li><a href="#sec-2-6-6">2.6.6 BADARMOR</a></li>
+<li><a href="#sec-2-6-7">2.6.7 DELETE_PROBLEM &lt;reason_code&gt;</a></li>
+<li><a href="#sec-2-6-8">2.6.8 PROGRESS &lt;what&gt; &lt;char&gt; &lt;cur&gt; &lt;total&gt;</a></li>
+<li><a href="#sec-2-6-9">2.6.9 BACKUP_KEY_CREATED &lt;fingerprint&gt; &lt;fname&gt;</a></li>
+<li><a href="#sec-2-6-10">2.6.10 MOUNTPOINT &lt;name&gt;</a></li>
+<li><a href="#sec-2-6-11">2.6.11 PINENTRY_LAUNCHED &lt;pid&gt;</a></li>
+</ul>
+</li>
+<li><a href="#sec-2-7">2.7 Obsolete status codes</a>
+<ul>
+<li><a href="#sec-2-7-1">2.7.1 SIGEXPIRED</a></li>
+<li><a href="#sec-2-7-2">2.7.2 RSA_OR_IDEA</a></li>
+<li><a href="#sec-2-7-3">2.7.3 SHM_INFO, SHM_GET, SHM_GET_BOOL, SHM_GET_HIDDEN</a></li>
+<li><a href="#sec-2-7-4">2.7.4 BEGIN_STREAM, END_STREAM</a></li>
+</ul></li>
+</ul>
+</li>
+<li><a href="#sec-3">3 Format of the &ndash;attribute-fd output</a></li>
+<li><a href="#sec-4">4 Unattended key generation</a></li>
+<li><a href="#sec-5">5 Layout of the TrustDB</a></li>
+<li><a href="#sec-6">6 GNU extensions to the S2K algorithm</a></li>
+<li><a href="#sec-7">7 Keyserver helper message format</a></li>
+<li><a href="#sec-8">8 Object identifiers</a></li>
+<li><a href="#sec-9">9 Miscellaneous notes</a>
+<ul>
+<li><a href="#sec-9-1">9.1 v3 fingerprints</a></li>
+<li><a href="#sec-9-2">9.2 Simplified revocation certificates</a></li>
+<li><a href="#sec-9-3">9.3 Documentation on HKP (the http keyserver protocol):</a></li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+
+<div id="outline-container-1" class="outline-2">
+<h2 id="sec-1"><span class="section-number-2">1</span> Format of the colon listings</h2>
+<div class="outline-text-2" id="text-1">
+
+<p> The format is a based on colon separated record, each recods starts
+ with a tag string and extends to the end of the line. Here is an
+ example:
+</p>
+
+
+<pre class="example">$ gpg --with-colons --list-keys \
+ --with-fingerprint --with-fingerprint wk@gnupg.org
+pub:f:1024:17:6C7EE1B8621CC013:899817715:1055898235::m:::scESC:
+fpr:::::::::ECAF7590EB3443B5C7CF3ACB6C7EE1B8621CC013:
+uid:f::::::::Werner Koch &lt;wk@g10code.com&gt;:
+uid:f::::::::Werner Koch &lt;wk@gnupg.org&gt;:
+sub:f:1536:16:06AD222CADF6A6E1:919537416:1036177416:::::e:
+fpr:::::::::CF8BCC4B18DE08FCD8A1615906AD222CADF6A6E1:
+sub:r:1536:20:5CE086B5B5A18FF4:899817788:1025961788:::::esc:
+fpr:::::::::AB059359A3B81F410FCFF97F5CE086B5B5A18FF4:
+</pre>
+
+
+<p>
+The double <code>--with-fingerprint</code> prints the fingerprint for the subkeys
+too. Old versions of gpg used a lighly different format and required
+the use of the option <code>--fixed-list-mode</code> to conform to format
+described here.
+</p>
+
+</div>
+
+<div id="outline-container-1-1" class="outline-3">
+<h3 id="sec-1-1"><span class="section-number-3">1.1</span> Description of the fields</h3>
+<div class="outline-text-3" id="text-1-1">
+
+
+</div>
+
+<div id="outline-container-1-1-1" class="outline-4">
+<h4 id="sec-1-1-1"><span class="section-number-4">1.1.1</span> Field 1 - Type of record</h4>
+<div class="outline-text-4" id="text-1-1-1">
+
+
+<dl>
+<dt>pub</dt><dd>Public key
+</dd>
+<dt>crt</dt><dd>X.509 certificate
+</dd>
+<dt>crs</dt><dd>X.509 certificate and private key available
+</dd>
+<dt>sub</dt><dd>Subkey (secondary key)
+</dd>
+<dt>sec</dt><dd>Secret key
+</dd>
+<dt>ssb</dt><dd>Secret subkey (secondary key)
+</dd>
+<dt>uid</dt><dd>User id (only field 10 is used).
+</dd>
+<dt>uat</dt><dd>User attribute (same as user id except for field 10).
+</dd>
+<dt>sig</dt><dd>Signature
+</dd>
+<dt>rev</dt><dd>Revocation signature
+</dd>
+<dt>fpr</dt><dd>Fingerprint (fingerprint is in field 10)
+</dd>
+<dt>pkd</dt><dd>Public key data [*]
+</dd>
+<dt>grp</dt><dd>Keygrip
+</dd>
+<dt>rvk</dt><dd>Revocation key
+</dd>
+<dt>tru</dt><dd>Trust database information [*]
+</dd>
+<dt>spk</dt><dd>Signature subpacket [*]
+</dd>
+<dt>cfg</dt><dd>Configuration data [*]
+</dd>
+</dl>
+
+
+<p>
+ Records marked with an asterisk are described at <a href="#Special-field-formats">*Special fields</a>.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-2" class="outline-4">
+<h4 id="sec-1-1-2"><span class="section-number-4">1.1.2</span> Field 2 - Validity</h4>
+<div class="outline-text-4" id="text-1-1-2">
+
+
+<p>
+ This is a letter describing the computed validity of a key.
+ Currently this is a single letter, but be prepared that additional
+ information may follow in some future versions. Note that GnuPG &lt;
+ 2.1 does not set this field for secret key listings.
+</p>
+<dl>
+<dt>o</dt><dd>Unknown (this key is new to the system)
+</dd>
+<dt>i</dt><dd>The key is invalid (e.g. due to a missing self-signature)
+</dd>
+<dt>d</dt><dd>The key has been disabled
+ (deprecated - use the 'D' in field 12 instead)
+</dd>
+<dt>r</dt><dd>The key has been revoked
+</dd>
+<dt>e</dt><dd>The key has expired
+</dd>
+<dt>-</dt><dd>Unknown validity (i.e. no value assigned)
+</dd>
+<dt>q</dt><dd>Undefined validity. '-' and 'q' may safely be treated as
+ the same value for most purposes
+</dd>
+<dt>n</dt><dd>The key is not valid
+</dd>
+<dt>m</dt><dd>The key is marginal valid.
+</dd>
+<dt>f</dt><dd>The key is fully valid
+</dd>
+<dt>u</dt><dd>The key is ultimately valid. This often means that the
+ secret key is available, but any key may be marked as
+ ultimately valid.
+</dd>
+<dt>w</dt><dd>The key has a well known private part.
+</dd>
+<dt>s</dt><dd>The key has special validity. This means that it might be
+ self-signed and expected to be used in the STEED sytem.
+</dd>
+</dl>
+
+
+<p>
+ If the validity information is given for a UID or UAT record, it
+ describes the validity calculated based on this user ID. If given
+ for a key record it describes the validity taken from the best
+ rated user ID.
+</p>
+<p>
+ For X.509 certificates a 'u' is used for a trusted root
+ certificate (i.e. for the trust anchor) and an 'f' for all other
+ valid certificates.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-3" class="outline-4">
+<h4 id="sec-1-1-3"><span class="section-number-4">1.1.3</span> Field 3 - Key length</h4>
+<div class="outline-text-4" id="text-1-1-3">
+
+
+<p>
+ The length of key in bits.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-4" class="outline-4">
+<h4 id="sec-1-1-4"><span class="section-number-4">1.1.4</span> Field 4 - Public key algorithm</h4>
+<div class="outline-text-4" id="text-1-1-4">
+
+
+<p>
+ The values here are those from the OpenPGP specs or if they are
+ greather than 255 the algorithm ids as used by Libgcrypt.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-5" class="outline-4">
+<h4 id="sec-1-1-5"><span class="section-number-4">1.1.5</span> Field 5 - KeyID</h4>
+<div class="outline-text-4" id="text-1-1-5">
+
+
+<p>
+ This is the 64 bit keyid as specified by OpenPGP and the last 64
+ bit of the SHA-1 fingerprint of an X.509 certifciate.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-6" class="outline-4">
+<h4 id="sec-1-1-6"><span class="section-number-4">1.1.6</span> Field 6 - Creation date</h4>
+<div class="outline-text-4" id="text-1-1-6">
+
+
+<p>
+ The creation date of the key is given in UTC. For UID and UAT
+ records, this is used for the self-signature date. Note that the
+ date is usally printed in seconds since epoch, however, we are
+ migrating to an ISO 8601 format (e.g. "19660205T091500"). This is
+ currently only relevant for X.509. A simple way to detect the new
+ format is to scan for the 'T'. Note that old versions of gpg
+ without using the <code>--fixed-list-mode</code> option used a "yyyy-mm-tt"
+ format.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-7" class="outline-4">
+<h4 id="sec-1-1-7"><span class="section-number-4">1.1.7</span> Field 7 - Expiration date</h4>
+<div class="outline-text-4" id="text-1-1-7">
+
+
+<p>
+ Key or UID/UAT expiration date or empty if it does not expire.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-8" class="outline-4">
+<h4 id="sec-1-1-8"><span class="section-number-4">1.1.8</span> Field 8 - Certificate S/N, UID hash, trust signature info</h4>
+<div class="outline-text-4" id="text-1-1-8">
+
+
+<p>
+ Used for serial number in crt records. For UID and UAT records,
+ this is a hash of the user ID contents used to represent that
+ exact user ID. For trust signatures, this is the trust depth
+ seperated by the trust value by a space.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-9" class="outline-4">
+<h4 id="sec-1-1-9"><span class="section-number-4">1.1.9</span> Field 9 - Ownertrust</h4>
+<div class="outline-text-4" id="text-1-1-9">
+
+
+<p>
+ This is only used on primary keys. This is a single letter, but
+ be prepared that additional information may follow in future
+ versions. For trust signatures with a regular expression, this is
+ the regular expression value, quoted as in field 10.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-10" class="outline-4">
+<h4 id="sec-1-1-10"><span class="section-number-4">1.1.10</span> Field 10 - User-ID</h4>
+<div class="outline-text-4" id="text-1-1-10">
+
+<p> The value is quoted like a C string to avoid control characters
+ (the colon is quoted <code>\x3a</code>). For a "pub" record this field is
+ not used on &ndash;fixed-list-mode. A UAT record puts the attribute
+ subpacket count here, a space, and then the total attribute
+ subpacket size. In gpgsm the issuer name comes here. A FPR
+ record stores the fingerprint here. The fingerprint of a
+ revocation key is stored here.
+</p></div>
+
+</div>
+
+<div id="outline-container-1-1-11" class="outline-4">
+<h4 id="sec-1-1-11"><span class="section-number-4">1.1.11</span> Field 11 - Signature class</h4>
+<div class="outline-text-4" id="text-1-1-11">
+
+
+<p>
+ Signature class as per RFC-4880. This is a 2 digit hexnumber
+ followed by either the letter 'x' for an exportable signature or
+ the letter 'l' for a local-only signature. The class byte of an
+ revocation key is also given here, 'x' and 'l' is used the same
+ way. This field if not used for X.509.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-12" class="outline-4">
+<h4 id="sec-1-1-12"><span class="section-number-4">1.1.12</span> Field 12 - Key capabilities</h4>
+<div class="outline-text-4" id="text-1-1-12">
+
+
+<p>
+ The defined capabilities are:
+</p>
+<dl>
+<dt>e</dt><dd>Encrypt
+</dd>
+<dt>s</dt><dd>Sign
+</dd>
+<dt>c</dt><dd>Certify
+</dd>
+<dt>a</dt><dd>Authentication
+</dd>
+<dt>?</dt><dd>Unknown capability
+</dd>
+</dl>
+
+
+<p>
+ A key may have any combination of them in any order. In addition
+ to these letters, the primary key has uppercase versions of the
+ letters to denote the <span style="text-decoration:underline;">usable</span> capabilities of the entire key, and
+ a potential letter 'D' to indicate a disabled key.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-13" class="outline-4">
+<h4 id="sec-1-1-13"><span class="section-number-4">1.1.13</span> Field 13 - Issuer certificate fingerprint or other info</h4>
+<div class="outline-text-4" id="text-1-1-13">
+
+
+<p>
+ Used in FPR records for S/MIME keys to store the fingerprint of
+ the issuer certificate. This is useful to build the certificate
+ path based on certificates stored in the local key database it is
+ only filled if the issuer certificate is available. The root has
+ been reached if this is the same string as the fingerprint. The
+ advantage of using this value is that it is guaranteed to have
+ been been build by the same lookup algorithm as gpgsm uses.
+</p>
+<p>
+ For "uid" records this field lists the preferences in the same way
+ gpg's &ndash;edit-key menu does.
+</p>
+<p>
+ For "sig" records, this is the fingerprint of the key that issued
+ the signature. Note that this is only filled in if the signature
+ verified correctly. Note also that for various technical reasons,
+ this fingerprint is only available if &ndash;no-sig-cache is used.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-14" class="outline-4">
+<h4 id="sec-1-1-14"><span class="section-number-4">1.1.14</span> Field 14 - Flag field</h4>
+<div class="outline-text-4" id="text-1-1-14">
+
+
+<p>
+ Flag field used in the &ndash;edit menu output
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-15" class="outline-4">
+<h4 id="sec-1-1-15"><span class="section-number-4">1.1.15</span> Field 15 - S/N of a token</h4>
+<div class="outline-text-4" id="text-1-1-15">
+
+
+<p>
+ Used in sec/sbb to print the serial number of a token (internal
+ protect mode 1002) or a '#' if that key is a simple stub (internal
+ protect mode 1001)
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-1-1-16" class="outline-4">
+<h4 id="sec-1-1-16"><span class="section-number-4">1.1.16</span> Field 16 - Hash algorithm</h4>
+<div class="outline-text-4" id="text-1-1-16">
+
+
+<p>
+ For sig records, this is the used hash algorithm. For example:
+ 2 = SHA-1, 8 = SHA-256.
+</p>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-1-2" class="outline-3">
+<h3 id="sec-1-2"><span class="section-number-3">1.2</span> Special fields</h3>
+<div class="outline-text-3" id="text-1-2">
+
+
+
+</div>
+
+<div id="outline-container-1-2-1" class="outline-4">
+<h4 id="sec-1-2-1"><span class="section-number-4">1.2.1</span> PKD - Public key data</h4>
+<div class="outline-text-4" id="text-1-2-1">
+
+
+<p>
+ If field 1 has the tag "pkd", a listing looks like this:
+</p>
+
+
+<pre class="example">pkd:0:1024:B665B1435F4C2 .... FF26ABB:
+ ! ! !-- the value
+ ! !------ for information number of bits in the value
+ !--------- index (eg. DSA goes from 0 to 3: p,q,g,y)
+</pre>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-1-2-2" class="outline-4">
+<h4 id="sec-1-2-2"><span class="section-number-4">1.2.2</span> TRU - Trust database information</h4>
+<div class="outline-text-4" id="text-1-2-2">
+
+<p> Example for a "tru" trust base record:
+</p>
+
+
+<pre class="example">tru:o:0:1166697654:1:3:1:5
+</pre>
+
+
+<dl>
+<dt>Field 2</dt><dd>Reason for staleness of trust. If this field is
+ empty, then the trustdb is not stale. This field may
+ have multiple flags in it:
+
+<dl>
+<dt>o</dt><dd>Trustdb is old
+</dd>
+<dt>t</dt><dd>Trustdb was built with a different trust model
+ than the one we are using now.
+
+</dd>
+</dl>
+
+</dd>
+<dt>Field 3</dt><dd>Trust model
+
+<dl>
+<dt>0</dt><dd>Classic trust model, as used in PGP 2.x.
+</dd>
+<dt>1</dt><dd>PGP trust model, as used in PGP 6 and later.
+ This is the same as the classic trust model,
+ except for the addition of trust signatures.
+
+</dd>
+</dl>
+
+<p> GnuPG before version 1.4 used the classic trust model
+ by default. GnuPG 1.4 and later uses the PGP trust
+ model by default.
+</p>
+</dd>
+<dt>Field 4</dt><dd>Date trustdb was created in seconds since Epoch.
+</dd>
+<dt>Field 5</dt><dd>Date trustdb will expire in seconds since Epoch.
+</dd>
+<dt>Field 6</dt><dd>Number of marginally trusted users to introduce a new
+ key signer (gpg's option &ndash;marginals-needed).
+</dd>
+<dt>Field 7</dt><dd>Number of completely trusted users to introduce a new
+ key signer. (gpg's option &ndash;completes-needed)
+
+</dd>
+<dt>Field 8</dt><dd>Maximum depth of a certification chain. (gpg's option
+ &ndash;max-cert-depth)
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-1-2-3" class="outline-4">
+<h4 id="sec-1-2-3"><span class="section-number-4">1.2.3</span> SPK - Signature subpacket records</h4>
+<div class="outline-text-4" id="text-1-2-3">
+
+
+<dl>
+<dt>Field 2</dt><dd>Subpacket number as per RFC-4880 and later.
+</dd>
+<dt>Field 3</dt><dd>Flags in hex. Currently the only two bits assigned
+ are 1, to indicate that the subpacket came from the
+ hashed part of the signature, and 2, to indicate the
+ subpacket was marked critical.
+</dd>
+<dt>Field 4</dt><dd>Length of the subpacket. Note that this is the
+ length of the subpacket, and not the length of field
+ 5 below. Due to the need for %-encoding, the length
+ of field 5 may be up to 3x this value.
+</dd>
+<dt>Field 5</dt><dd>The subpacket data. Printable ASCII is shown as
+ ASCII, but other values are rendered as %XX where XX
+ is the hex value for the byte.
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-1-2-4" class="outline-4">
+<h4 id="sec-1-2-4"><span class="section-number-4">1.2.4</span> CFG - Configuration data</h4>
+<div class="outline-text-4" id="text-1-2-4">
+
+
+<p>
+ &ndash;list-config outputs information about the GnuPG configuration
+ for the benefit of frontends or other programs that call GnuPG.
+ There are several list-config items, all colon delimited like the
+ rest of the &ndash;with-colons output. The first field is always "cfg"
+ to indicate configuration information. The second field is one of
+ (with examples):
+</p>
+<dl>
+<dt>version</dt><dd>The third field contains the version of GnuPG.
+
+<pre class="example">
+cfg:version:1.3.5
+</pre>
+
+
+</dd>
+<dt>pubkey</dt><dd>The third field contains the public key algorithms
+ this version of GnuPG supports, separated by
+ semicolons. The algorithm numbers are as specified in
+ RFC-4880. Note that in contrast to the &ndash;status-fd
+ interface these are <span style="text-decoration:underline;">not</span> the Libgcrypt identifiers.
+
+<pre class="example">
+cfg:pubkey:1;2;3;16;17
+</pre>
+
+
+</dd>
+<dt>cipher</dt><dd>The third field contains the symmetric ciphers this
+ version of GnuPG supports, separated by semicolons.
+ The cipher numbers are as specified in RFC-4880.
+
+<pre class="example">
+cfg:cipher:2;3;4;7;8;9;10
+</pre>
+
+
+</dd>
+<dt>digest</dt><dd>The third field contains the digest (hash) algorithms
+ this version of GnuPG supports, separated by
+ semicolons. The digest numbers are as specified in
+ RFC-4880.
+
+<pre class="example">
+cfg:digest:1;2;3;8;9;10
+</pre>
+
+
+</dd>
+<dt>compress</dt><dd>The third field contains the compression algorithms
+ this version of GnuPG supports, separated by
+ semicolons. The algorithm numbers are as specified
+ in RFC-4880.
+
+<pre class="example">
+cfg:compress:0;1;2;3
+</pre>
+
+
+</dd>
+<dt>group</dt><dd>The third field contains the name of the group, and the
+ fourth field contains the values that the group expands
+ to, separated by semicolons.
+
+<p>
+ For example, a group of:
+</p><pre class="example">
+group mynames = paige 0x12345678 joe patti
+</pre>
+
+<p> would result in:
+</p><pre class="example">
+cfg:group:mynames:patti;joe;0x12345678;paige
+</pre>
+
+</dd>
+</dl>
+
+
+
+</div>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2" class="outline-2">
+<h2 id="sec-2"><span class="section-number-2">2</span> Format of the &ndash;status-fd output</h2>
+<div class="outline-text-2" id="text-2">
+
+
+<p>
+ Every line is prefixed with "[GNUPG:] ", followed by a keyword with
+ the type of the status line and some arguments depending on the type
+ (maybe none); an application should always be prepared to see more
+ arguments in future versions.
+</p>
+
+</div>
+
+<div id="outline-container-2-1" class="outline-3">
+<h3 id="sec-2-1"><span class="section-number-3">2.1</span> General status codes</h3>
+<div class="outline-text-3" id="text-2-1">
+
+
+</div>
+
+<div id="outline-container-2-1-1" class="outline-4">
+<h4 id="sec-2-1-1"><span class="section-number-4">2.1.1</span> NEWSIG</h4>
+<div class="outline-text-4" id="text-2-1-1">
+
+<p> May be issued right before a signature verification starts. This
+ is useful to define a context for parsing ERROR status messages.
+ No arguments are currently defined.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-2" class="outline-4">
+<h4 id="sec-2-1-2"><span class="section-number-4">2.1.2</span> GOODSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</h4>
+<div class="outline-text-4" id="text-2-1-2">
+
+<p> The signature with the keyid is good. For each signature only one
+ of the codes GOODSIG, BADSIG, EXPSIG, EXPKEYSIG, REVKEYSIG or
+ ERRSIG will be emitted. In the past they were used as a marker
+ for a new signature; new code should use the NEWSIG status
+ instead. The username is the primary one encoded in UTF-8 and %XX
+ escaped. The fingerprint may be used instead of the long keyid if
+ it is available. This is the case with CMS and might eventually
+ also be available for OpenPGP.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-3" class="outline-4">
+<h4 id="sec-2-1-3"><span class="section-number-4">2.1.3</span> EXPSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</h4>
+<div class="outline-text-4" id="text-2-1-3">
+
+<p> The signature with the keyid is good, but the signature is
+ expired. The username is the primary one encoded in UTF-8 and %XX
+ escaped. The fingerprint may be used instead of the long keyid if
+ it is available. This is the case with CMS and might eventually
+ also be available for OpenPGP.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-4" class="outline-4">
+<h4 id="sec-2-1-4"><span class="section-number-4">2.1.4</span> EXPKEYSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</h4>
+<div class="outline-text-4" id="text-2-1-4">
+
+<p> The signature with the keyid is good, but the signature was made
+ by an expired key. The username is the primary one encoded in
+ UTF-8 and %XX escaped. The fingerprint may be used instead of the
+ long keyid if it is available. This is the case with CMS and
+ might eventually also be available for OpenPGP.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-5" class="outline-4">
+<h4 id="sec-2-1-5"><span class="section-number-4">2.1.5</span> REVKEYSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</h4>
+<div class="outline-text-4" id="text-2-1-5">
+
+<p> The signature with the keyid is good, but the signature was made
+ by a revoked key. The username is the primary one encoded in UTF-8
+ and %XX escaped. The fingerprint may be used instead of the long
+ keyid if it is available. This is the case with CMS and might
+ eventually also beñ available for OpenPGP.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-6" class="outline-4">
+<h4 id="sec-2-1-6"><span class="section-number-4">2.1.6</span> BADSIG &lt;long_keyid_or_fpr&gt; &lt;username&gt;</h4>
+<div class="outline-text-4" id="text-2-1-6">
+
+<p> The signature with the keyid has not been verified okay. The
+ username is the primary one encoded in UTF-8 and %XX escaped. The
+ fingerprint may be used instead of the long keyid if it is
+ available. This is the case with CMS and might eventually also be
+ available for OpenPGP.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-7" class="outline-4">
+<h4 id="sec-2-1-7"><span class="section-number-4">2.1.7</span> ERRSIG &lt;keyid&gt; &lt;pkalgo&gt; &lt;hashalgo&gt; &lt;sig_class&gt; &lt;time&gt; &lt;rc&gt;</h4>
+<div class="outline-text-4" id="text-2-1-7">
+
+<p> It was not possible to check the signature. This may be caused by
+ a missing public key or an unsupported algorithm. A RC of 4
+ indicates unknown algorithm, a 9 indicates a missing public
+ key. The other fields give more information about this signature.
+ sig_class is a 2 byte hex-value. The fingerprint may be used
+ instead of the keyid if it is available. This is the case with
+ gpgsm and might eventually also be available for OpenPGP.
+</p>
+<p>
+ Note, that TIME may either be the number of seconds since Epoch or
+ the letter 'T'.
+ an ISO 8601 string. The latter can be detected by the presence of
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-8" class="outline-4">
+<h4 id="sec-2-1-8"><span class="section-number-4">2.1.8</span> VALIDSIG &lt;args&gt;</h4>
+<div class="outline-text-4" id="text-2-1-8">
+
+
+<p>
+ The args are:
+</p>
+<ul>
+<li>&lt;fingerprint_in_hex&gt;
+</li>
+<li>&lt;sig_creation_date&gt;
+</li>
+<li>&lt;sig-timestamp&gt;
+</li>
+<li>&lt;expire-timestamp&gt;
+</li>
+<li>&lt;sig-version&gt;
+</li>
+<li>&lt;reserved&gt;
+</li>
+<li>&lt;pubkey-algo&gt;
+</li>
+<li>&lt;hash-algo&gt;
+</li>
+<li>&lt;sig-class&gt;
+</li>
+<li>[ &lt;primary-key-fpr&gt; ]
+</li>
+</ul>
+
+
+<p>
+ This status indicates that the signature is good. This is the same
+ as GOODSIG but has the fingerprint as the argument. Both status
+ lines are emitted for a good signature. All arguments here are on
+ one long line. sig-timestamp is the signature creation time in
+ seconds after the epoch. expire-timestamp is the signature
+ expiration time in seconds after the epoch (zero means "does not
+ expire"). sig-version, pubkey-algo, hash-algo, and sig-class (a
+ 2-byte hex value) are all straight from the signature packet.
+ PRIMARY-KEY-FPR is the fingerprint of the primary key or identical
+ to the first argument. This is useful to get back to the primary
+ key without running gpg again for this purpose.
+</p>
+<p>
+ The primary-key-fpr parameter is used for OpenPGP and not
+ class is not defined for CMS and currently set to 0 and 00.
+ available for CMS signatures. The sig-version as well as the sig
+</p>
+<p>
+ Note, that *-TIMESTAMP may either be a number of seconds since
+ Epoch or an ISO 8601 string which can be detected by the presence
+ of the letter 'T'.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-9" class="outline-4">
+<h4 id="sec-2-1-9"><span class="section-number-4">2.1.9</span> SIG_ID &lt;radix64_string&gt; &lt;sig_creation_date&gt; &lt;sig-timestamp&gt;</h4>
+<div class="outline-text-4" id="text-2-1-9">
+
+<p> This is emitted only for signatures of class 0 or 1 which have
+ been verified okay. The string is a signature id and may be used
+ in applications to detect replay attacks of signed messages. Note
+ that only DLP algorithms give unique ids - others may yield
+ duplicated ones when they have been created in the same second.
+</p>
+<p>
+ Note, that SIG-TIMESTAMP may either be a number of seconds since
+ Epoch or an ISO 8601 string which can be detected by the presence
+ of the letter 'T'.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-10" class="outline-4">
+<h4 id="sec-2-1-10"><span class="section-number-4">2.1.10</span> ENC_TO &lt;long_keyid&gt; &lt;keytype&gt; &lt;keylength&gt;</h4>
+<div class="outline-text-4" id="text-2-1-10">
+
+<p> The message is encrypted to this LONG_KEYID. KEYTYPE is the
+ numerical value of the public key algorithm or 0 if it is not
+ known, KEYLENGTH is the length of the key or 0 if it is not known
+ (which is currently always the case). Gpg prints this line
+ always; Gpgsm only if it knows the certificate.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-11" class="outline-4">
+<h4 id="sec-2-1-11"><span class="section-number-4">2.1.11</span> BEGIN_DECRYPTION</h4>
+<div class="outline-text-4" id="text-2-1-11">
+
+<p> Mark the start of the actual decryption process. This is also
+ emitted when in &ndash;list-only mode.
+</p></div>
+
+</div>
+
+<div id="outline-container-2-1-12" class="outline-4">
+<h4 id="sec-2-1-12"><span class="section-number-4">2.1.12</span> END_DECRYPTION</h4>
+<div class="outline-text-4" id="text-2-1-12">
+
+<p> Mark the end of the actual decryption process. This are also
+ emitted when in &ndash;list-only mode.
+</p></div>
+
+</div>
+
+<div id="outline-container-2-1-13" class="outline-4">
+<h4 id="sec-2-1-13"><span class="section-number-4">2.1.13</span> DECRYPTION_INFO &lt;mdc_method&gt; &lt;sym_algo&gt;</h4>
+<div class="outline-text-4" id="text-2-1-13">
+
+<p> Print information about the symmetric encryption algorithm and the
+ MDC method. This will be emitted even if the decryption fails.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-14" class="outline-4">
+<h4 id="sec-2-1-14"><span class="section-number-4">2.1.14</span> DECRYPTION_FAILED</h4>
+<div class="outline-text-4" id="text-2-1-14">
+
+<p> The symmetric decryption failed - one reason could be a wrong
+ passphrase for a symmetrical encrypted message.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-15" class="outline-4">
+<h4 id="sec-2-1-15"><span class="section-number-4">2.1.15</span> DECRYPTION_OKAY</h4>
+<div class="outline-text-4" id="text-2-1-15">
+
+<p> The decryption process succeeded. This means, that either the
+ correct secret key has been used or the correct passphrase for a
+ conventional encrypted message was given. The program itself may
+ return an errorcode because it may not be possible to verify a
+ signature for some reasons.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-16" class="outline-4">
+<h4 id="sec-2-1-16"><span class="section-number-4">2.1.16</span> SESSION_KEY &lt;algo&gt;:&lt;hexdigits&gt;</h4>
+<div class="outline-text-4" id="text-2-1-16">
+
+<p> The session key used to decrypt the message. This message will
+ only be emitted when the special option &ndash;show-session-key is
+ used. The format is suitable to be passed to the option
+ &ndash;override-session-key
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-17" class="outline-4">
+<h4 id="sec-2-1-17"><span class="section-number-4">2.1.17</span> BEGIN_ENCRYPTION &lt;mdc_method&gt; &lt;sym_algo&gt;</h4>
+<div class="outline-text-4" id="text-2-1-17">
+
+<p> Mark the start of the actual encryption process.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-18" class="outline-4">
+<h4 id="sec-2-1-18"><span class="section-number-4">2.1.18</span> END_ENCRYPTION</h4>
+<div class="outline-text-4" id="text-2-1-18">
+
+<p> Mark the end of the actual encryption process.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-19" class="outline-4">
+<h4 id="sec-2-1-19"><span class="section-number-4">2.1.19</span> FILE_START &lt;what&gt; &lt;filename&gt;</h4>
+<div class="outline-text-4" id="text-2-1-19">
+
+<p> Start processing a file &lt;filename&gt;. &lt;what&gt; indicates the performed
+ operation:
+</p><dl>
+<dt>1</dt><dd>verify
+</dd>
+<dt>2</dt><dd>encrypt
+</dd>
+<dt>3</dt><dd>decrypt
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-1-20" class="outline-4">
+<h4 id="sec-2-1-20"><span class="section-number-4">2.1.20</span> FILE_DONE</h4>
+<div class="outline-text-4" id="text-2-1-20">
+
+<p> Marks the end of a file processing which has been started
+ by FILE_START.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-21" class="outline-4">
+<h4 id="sec-2-1-21"><span class="section-number-4">2.1.21</span> BEGIN_SIGNING</h4>
+<div class="outline-text-4" id="text-2-1-21">
+
+<p> Mark the start of the actual signing process. This may be used as
+ an indication that all requested secret keys are ready for use.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-22" class="outline-4">
+<h4 id="sec-2-1-22"><span class="section-number-4">2.1.22</span> ALREADY_SIGNED &lt;long-keyid&gt;</h4>
+<div class="outline-text-4" id="text-2-1-22">
+
+<p> Warning: This is experimental and might be removed at any time.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-23" class="outline-4">
+<h4 id="sec-2-1-23"><span class="section-number-4">2.1.23</span> SIG_CREATED &lt;type&gt; &lt;pk_algo&gt; &lt;hash_algo&gt; &lt;class&gt; &lt;timestamp&gt; &lt;keyfpr&gt;</h4>
+<div class="outline-text-4" id="text-2-1-23">
+
+<p> A signature has been created using these parameters.
+ Values for type &lt;type&gt; are:
+</p><dl>
+<dt>D</dt><dd>detached
+</dd>
+<dt>C</dt><dd>cleartext
+</dd>
+<dt>S</dt><dd>standard
+</dd>
+</dl>
+
+<p> (only the first character should be checked)
+</p>
+<p>
+ &lt;class&gt; are 2 hex digits with the OpenPGP signature class.
+</p>
+<p>
+ Note, that TIMESTAMP may either be a number of seconds since Epoch
+ or an ISO 8601 string which can be detected by the presence of the
+ letter 'T'.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-24" class="outline-4">
+<h4 id="sec-2-1-24"><span class="section-number-4">2.1.24</span> NOTATION_</h4>
+<div class="outline-text-4" id="text-2-1-24">
+
+<p> There are actually two related status codes to convey notation
+ data:
+</p>
+<ul>
+<li>NOTATION_NAME &lt;name&gt;
+</li>
+<li>NOTATION_DATA &lt;string&gt;
+</li>
+</ul>
+
+
+<p>
+ &lt;name&gt; and &lt;string&gt; are %XX escaped; the data may be split among
+ several NOTATION_DATA lines.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-25" class="outline-4">
+<h4 id="sec-2-1-25"><span class="section-number-4">2.1.25</span> POLICY_URL &lt;string&gt;</h4>
+<div class="outline-text-4" id="text-2-1-25">
+
+<p> Note that URL in &lt;string&gt; is %XX escaped.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-26" class="outline-4">
+<h4 id="sec-2-1-26"><span class="section-number-4">2.1.26</span> PLAINTEXT &lt;format&gt; &lt;timestamp&gt; &lt;filename&gt;</h4>
+<div class="outline-text-4" id="text-2-1-26">
+
+<p> This indicates the format of the plaintext that is about to be
+ written. The format is a 1 byte hex code that shows the format of
+ the plaintext: 62 ('b') is binary data, 74 ('t') is text data with
+ no character set specified, and 75 ('u') is text data encoded in
+ the UTF-8 character set. The timestamp is in seconds since the
+ epoch. If a filename is available it gets printed as the third
+ argument, percent-escaped as usual.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-27" class="outline-4">
+<h4 id="sec-2-1-27"><span class="section-number-4">2.1.27</span> PLAINTEXT_LENGTH &lt;length&gt;</h4>
+<div class="outline-text-4" id="text-2-1-27">
+
+<p> This indicates the length of the plaintext that is about to be
+ written. Note that if the plaintext packet has partial length
+ encoding it is not possible to know the length ahead of time. In
+ that case, this status tag does not appear.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-1-28" class="outline-4">
+<h4 id="sec-2-1-28"><span class="section-number-4">2.1.28</span> ATTRIBUTE &lt;arguments&gt;</h4>
+<div class="outline-text-4" id="text-2-1-28">
+
+<p> The list or argemnts are:
+</p><ul>
+<li>&lt;fpr&gt;
+</li>
+<li>&lt;octets&gt;
+</li>
+<li>&lt;type&gt;
+</li>
+<li>&lt;index&gt;
+</li>
+<li>&lt;count&gt;
+</li>
+<li>&lt;timestamp&gt;
+</li>
+<li>&lt;expiredate&gt;
+</li>
+<li>&lt;flags&gt;
+</li>
+</ul>
+
+
+<p>
+ This is one long line issued for each attribute subpacket when an
+ attribute packet is seen during key listing. &lt;fpr&gt; is the
+ fingerprint of the key. &lt;octets&gt; is the length of the attribute
+ subpacket. &lt;type&gt; is the attribute type (e.g. 1 for an image).
+ &lt;index&gt; and &lt;count&gt; indicate that this is the N-th indexed
+ subpacket of count total subpackets in this attribute packet.
+ &lt;timestamp&gt; and &lt;expiredate&gt; are from the self-signature on the
+ attribute packet. If the attribute packet does not have a valid
+ self-signature, then the timestamp is 0. &lt;flags&gt; are a bitwise OR
+ of:
+</p><dl>
+<dt>0x01</dt><dd>this attribute packet is a primary uid
+</dd>
+<dt>0x02</dt><dd>this attribute packet is revoked
+</dd>
+<dt>0x04</dt><dd>this attribute packet is expired
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-1-29" class="outline-4">
+<h4 id="sec-2-1-29"><span class="section-number-4">2.1.29</span> SIG_SUBPACKET &lt;type&gt; &lt;flags&gt; &lt;len&gt; &lt;data&gt;</h4>
+<div class="outline-text-4" id="text-2-1-29">
+
+<p> This indicates that a signature subpacket was seen. The format is
+ the same as the "spk" record above.
+</p>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2-2" class="outline-3">
+<h3 id="sec-2-2"><span class="section-number-3">2.2</span> Key related</h3>
+<div class="outline-text-3" id="text-2-2">
+
+
+</div>
+
+<div id="outline-container-2-2-1" class="outline-4">
+<h4 id="sec-2-2-1"><span class="section-number-4">2.2.1</span> INV_RECP, INV_SGNR</h4>
+<div class="outline-text-4" id="text-2-2-1">
+
+<p> The two similar status codes:
+</p>
+<ul>
+<li>INV_RECP &lt;reason&gt; &lt;requested_recipient&gt;
+</li>
+<li>INV_SGNR &lt;reason&gt; &lt;requested_sender&gt;
+</li>
+</ul>
+
+
+<p>
+ are issued for each unusable recipient/sender. The reasons codes
+ currently in use are:
+</p>
+<dl>
+<dt>0</dt><dd>No specific reason given
+</dd>
+<dt>1</dt><dd>Not Found
+</dd>
+<dt>2</dt><dd>Ambigious specification
+</dd>
+<dt>3</dt><dd>Wrong key usage
+</dd>
+<dt>4</dt><dd>Key revoked
+</dd>
+<dt>5</dt><dd>Key expired
+</dd>
+<dt>6</dt><dd>No CRL known
+</dd>
+<dt>7</dt><dd>CRL too old
+</dd>
+<dt>8</dt><dd>Policy mismatch
+</dd>
+<dt>9</dt><dd>Not a secret key
+</dd>
+<dt>10</dt><dd>Key not trusted
+</dd>
+<dt>11</dt><dd>Missing certificate
+</dd>
+<dt>12</dt><dd>Missing issuer certificate
+</dd>
+</dl>
+
+
+<p>
+ Note that for historical reasons the INV_RECP status is also used
+ for gpgsm's SIGNER command where it relates to signer's of course.
+ Newer GnuPG versions are using INV_SGNR; applications should
+ ignore the INV_RECP during the sender's command processing once
+ they have seen an INV_SGNR. Different codes are used so that they
+ can be distinguish while doing an encrypt+sign operation.
+</p></div>
+
+</div>
+
+<div id="outline-container-2-2-2" class="outline-4">
+<h4 id="sec-2-2-2"><span class="section-number-4">2.2.2</span> NO_RECP &lt;reserved&gt;</h4>
+<div class="outline-text-4" id="text-2-2-2">
+
+<p> Issued if no recipients are usable.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-3" class="outline-4">
+<h4 id="sec-2-2-3"><span class="section-number-4">2.2.3</span> NO_SGNR &lt;reserved&gt;</h4>
+<div class="outline-text-4" id="text-2-2-3">
+
+<p> Issued if no senders are usable.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-4" class="outline-4">
+<h4 id="sec-2-2-4"><span class="section-number-4">2.2.4</span> KEYEXPIRED &lt;expire-timestamp&gt;</h4>
+<div class="outline-text-4" id="text-2-2-4">
+
+<p> The key has expired. expire-timestamp is the expiration time in
+ seconds since Epoch. This status line is not very useful because
+ it will also be emitted for expired subkeys even if this subkey is
+ not used. To check whether a key used to sign a message has
+ expired, the EXPKEYSIG status line is to be used.
+</p>
+<p>
+ Note, that the TIMESTAMP may either be a number of seconds since
+ Epoch or an ISO 8601 string which can be detected by the presence
+ of the letter 'T'.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-5" class="outline-4">
+<h4 id="sec-2-2-5"><span class="section-number-4">2.2.5</span> KEYREVOKED</h4>
+<div class="outline-text-4" id="text-2-2-5">
+
+<p> The used key has been revoked by its owner. No arguments yet.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-6" class="outline-4">
+<h4 id="sec-2-2-6"><span class="section-number-4">2.2.6</span> NO_PUBKEY &lt;long keyid&gt;</h4>
+<div class="outline-text-4" id="text-2-2-6">
+
+<p> The public key is not available
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-7" class="outline-4">
+<h4 id="sec-2-2-7"><span class="section-number-4">2.2.7</span> NO_SECKEY &lt;long keyid&gt;</h4>
+<div class="outline-text-4" id="text-2-2-7">
+
+<p> The secret key is not available
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-8" class="outline-4">
+<h4 id="sec-2-2-8"><span class="section-number-4">2.2.8</span> KEY_CREATED &lt;type&gt; &lt;fingerprint&gt; [&lt;handle&gt;]</h4>
+<div class="outline-text-4" id="text-2-2-8">
+
+<p> A key has been created. Values for &lt;type&gt; are:
+</p><dl>
+<dt>B</dt><dd>primary and subkey
+</dd>
+<dt>P</dt><dd>primary
+</dd>
+<dt>S</dt><dd>subkey
+</dd>
+</dl>
+
+<p> The fingerprint is one of the primary key for type B and P and the
+ one of the subkey for S. Handle is an arbitrary non-whitespace
+ string used to match key parameters from batch key creation run.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-9" class="outline-4">
+<h4 id="sec-2-2-9"><span class="section-number-4">2.2.9</span> KEY_NOT_CREATED [&lt;handle&gt;]</h4>
+<div class="outline-text-4" id="text-2-2-9">
+
+<p> The key from batch run has not been created due to errors.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-10" class="outline-4">
+<h4 id="sec-2-2-10"><span class="section-number-4">2.2.10</span> TRUST_</h4>
+<div class="outline-text-4" id="text-2-2-10">
+
+<p> These are several similar status codes:
+</p>
+<ul>
+<li>TRUST_UNDEFINED &lt;error_token&gt;
+</li>
+<li>TRUST_NEVER &lt;error_token&gt;
+</li>
+<li>TRUST_MARGINAL [0 [&lt;validation_model&gt;]]
+</li>
+<li>TRUST_FULLY [0 [&lt;validation_model&gt;]]
+</li>
+<li>TRUST_ULTIMATE [0 [&lt;validation_model&gt;]]
+</li>
+</ul>
+
+
+<p>
+ For good signatures one of these status lines are emitted to
+ indicate the validity of the key used to create the signature.
+ The error token values are currently only emitted by gpgsm.
+</p>
+<p>
+ VALIDATION_MODEL describes the algorithm used to check the
+ validity of the key. The defaults are the standard Web of Trust
+ model for gpg and the the standard X.509 model for gpgsm. The
+ defined values are
+</p>
+<dl>
+<dt>pgp </dt><dd>The standard PGP WoT.
+</dd>
+<dt>shell</dt><dd>The standard X.509 model.
+</dd>
+<dt>chain</dt><dd>The chain model.
+</dd>
+<dt>steed</dt><dd>The STEED model.
+</dd>
+</dl>
+
+
+<p>
+ Note that the term <code>TRUST_</code> in the status names is used for
+ historic reasons; we now speak of validity.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-2-11" class="outline-4">
+<h4 id="sec-2-2-11"><span class="section-number-4">2.2.11</span> PKA_TRUST_</h4>
+<div class="outline-text-4" id="text-2-2-11">
+
+<p> This is is one:
+</p>
+<ul>
+<li>PKA_TRUST_GOOD &lt;mailbox&gt;
+</li>
+<li>PKA_TRUST_BAD &lt;mailbox&gt;
+</li>
+</ul>
+
+
+<p>
+ Depending on the outcome of the PKA check one of the above status
+ codes is emitted in addition to a <code>TRUST_*</code> status.
+</p>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2-3" class="outline-3">
+<h3 id="sec-2-3"><span class="section-number-3">2.3</span> Remote control</h3>
+<div class="outline-text-3" id="text-2-3">
+
+
+</div>
+
+<div id="outline-container-2-3-1" class="outline-4">
+<h4 id="sec-2-3-1"><span class="section-number-4">2.3.1</span> GET_BOOL, GET_LINE, GET_HIDDEN, GOT_IT</h4>
+<div class="outline-text-4" id="text-2-3-1">
+
+
+<p>
+ These status line are used with &ndash;command-fd for interactive
+ control of the process.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-2" class="outline-4">
+<h4 id="sec-2-3-2"><span class="section-number-4">2.3.2</span> USERID_HINT &lt;long main keyid&gt; &lt;string&gt;</h4>
+<div class="outline-text-4" id="text-2-3-2">
+
+<p> Give a hint about the user ID for a certain keyID.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-3" class="outline-4">
+<h4 id="sec-2-3-3"><span class="section-number-4">2.3.3</span> NEED_PASSPHRASE &lt;long keyid&gt; &lt;long main keyid&gt; &lt;keytype&gt; &lt;keylength&gt;</h4>
+<div class="outline-text-4" id="text-2-3-3">
+
+<p> Issued whenever a passphrase is needed. KEYTYPE is the numerical
+ value of the public key algorithm or 0 if this is not applicable,
+ KEYLENGTH is the length of the key or 0 if it is not known (this
+ is currently always the case).
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-4" class="outline-4">
+<h4 id="sec-2-3-4"><span class="section-number-4">2.3.4</span> NEED_PASSPHRASE_SYM &lt;cipher_algo&gt; &lt;s2k_mode&gt; &lt;s2k_hash&gt;</h4>
+<div class="outline-text-4" id="text-2-3-4">
+
+<p> Issued whenever a passphrase for symmetric encryption is needed.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-5" class="outline-4">
+<h4 id="sec-2-3-5"><span class="section-number-4">2.3.5</span> NEED_PASSPHRASE_PIN &lt;card_type&gt; &lt;chvno&gt; [&lt;serialno&gt;]</h4>
+<div class="outline-text-4" id="text-2-3-5">
+
+<p> Issued whenever a PIN is requested to unlock a card.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-6" class="outline-4">
+<h4 id="sec-2-3-6"><span class="section-number-4">2.3.6</span> MISSING_PASSPHRASE</h4>
+<div class="outline-text-4" id="text-2-3-6">
+
+<p> No passphrase was supplied. An application which encounters this
+ message may want to stop parsing immediately because the next
+ message will probably be a BAD_PASSPHRASE. However, if the
+ application is a wrapper around the key edit menu functionality it
+ might not make sense to stop parsing but simply ignoring the
+ following BAD_PASSPHRASE.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-7" class="outline-4">
+<h4 id="sec-2-3-7"><span class="section-number-4">2.3.7</span> BAD_PASSPHRASE &lt;long keyid&gt;</h4>
+<div class="outline-text-4" id="text-2-3-7">
+
+<p> The supplied passphrase was wrong or not given. In the latter
+ case you may have seen a MISSING_PASSPHRASE.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-3-8" class="outline-4">
+<h4 id="sec-2-3-8"><span class="section-number-4">2.3.8</span> GOOD_PASSPHRASE</h4>
+<div class="outline-text-4" id="text-2-3-8">
+
+<p> The supplied passphrase was good and the secret key material
+ is therefore usable.
+</p>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2-4" class="outline-3">
+<h3 id="sec-2-4"><span class="section-number-3">2.4</span> Import/Export</h3>
+<div class="outline-text-3" id="text-2-4">
+
+
+</div>
+
+<div id="outline-container-2-4-1" class="outline-4">
+<h4 id="sec-2-4-1"><span class="section-number-4">2.4.1</span> IMPORT_CHECK &lt;long keyid&gt; &lt;fingerprint&gt; &lt;user ID&gt;</h4>
+<div class="outline-text-4" id="text-2-4-1">
+
+<p> This status is emitted in interactive mode right before
+ the "import.okay" prompt.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-4-2" class="outline-4">
+<h4 id="sec-2-4-2"><span class="section-number-4">2.4.2</span> IMPORTED &lt;long keyid&gt; &lt;username&gt;</h4>
+<div class="outline-text-4" id="text-2-4-2">
+
+<p> The keyid and name of the signature just imported
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-4-3" class="outline-4">
+<h4 id="sec-2-4-3"><span class="section-number-4">2.4.3</span> IMPORT_OK &lt;reason&gt; [&lt;fingerprint&gt;]</h4>
+<div class="outline-text-4" id="text-2-4-3">
+
+<p> The key with the primary key's FINGERPRINT has been imported.
+ REASON flags are:
+</p>
+<dl>
+<dt>0</dt><dd>Not actually changed
+</dd>
+<dt>1</dt><dd>Entirely new key.
+</dd>
+<dt>2</dt><dd>New user IDs
+</dd>
+<dt>4</dt><dd>New signatures
+</dd>
+<dt>8</dt><dd>New subkeys
+</dd>
+<dt>16</dt><dd>Contains private key.
+</dd>
+</dl>
+
+
+<p>
+ The flags may be ORed.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-4-4" class="outline-4">
+<h4 id="sec-2-4-4"><span class="section-number-4">2.4.4</span> IMPORT_PROBLEM &lt;reason&gt; [&lt;fingerprint&gt;]</h4>
+<div class="outline-text-4" id="text-2-4-4">
+
+<p> Issued for each import failure. Reason codes are:
+</p>
+<dl>
+<dt>0</dt><dd>No specific reason given.
+</dd>
+<dt>1</dt><dd>Invalid Certificate.
+</dd>
+<dt>2</dt><dd>Issuer Certificate missing.
+</dd>
+<dt>3</dt><dd>Certificate Chain too long.
+</dd>
+<dt>4</dt><dd>Error storing certificate.
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-4-5" class="outline-4">
+<h4 id="sec-2-4-5"><span class="section-number-4">2.4.5</span> IMPORT_RES &lt;args&gt;</h4>
+<div class="outline-text-4" id="text-2-4-5">
+
+<p> Final statistics on import process (this is one long line). The
+ args are a list of unsigned numbers separated by white space:
+</p>
+<ul>
+<li>&lt;count&gt;
+</li>
+<li>&lt;no_user_id&gt;
+</li>
+<li>&lt;imported&gt;
+</li>
+<li>&lt;imported_rsa&gt;
+</li>
+<li>&lt;unchanged&gt;
+</li>
+<li>&lt;n_uids&gt;
+</li>
+<li>&lt;n_subk&gt;
+</li>
+<li>&lt;n_sigs&gt;
+</li>
+<li>&lt;n_revoc&gt;
+</li>
+<li>&lt;sec_read&gt;
+</li>
+<li>&lt;sec_imported&gt;
+</li>
+<li>&lt;sec_dups&gt;
+</li>
+<li>&lt;skipped_new_keys&gt;
+</li>
+<li>&lt;not_imported&gt;
+</li>
+</ul>
+
+
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2-5" class="outline-3">
+<h3 id="sec-2-5"><span class="section-number-3">2.5</span> Smartcard related</h3>
+<div class="outline-text-3" id="text-2-5">
+
+
+</div>
+
+<div id="outline-container-2-5-1" class="outline-4">
+<h4 id="sec-2-5-1"><span class="section-number-4">2.5.1</span> CARDCTRL &lt;what&gt; [&lt;serialno&gt;]</h4>
+<div class="outline-text-4" id="text-2-5-1">
+
+<p> This is used to control smartcard operations. Defined values for
+ WHAT are:
+</p>
+<dl>
+<dt>1</dt><dd>Request insertion of a card. Serialnumber may be given
+ to request a specific card. Used by gpg 1.4 w/o
+ scdaemon
+</dd>
+<dt>2</dt><dd>Request removal of a card. Used by gpg 1.4 w/o scdaemon.
+</dd>
+<dt>3</dt><dd>Card with serialnumber detected
+</dd>
+<dt>4</dt><dd>No card available
+</dd>
+<dt>5</dt><dd>No card reader available
+</dd>
+<dt>6</dt><dd>No card support available
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-5-2" class="outline-4">
+<h4 id="sec-2-5-2"><span class="section-number-4">2.5.2</span> SC_OP_FAILURE [&lt;code&gt;]</h4>
+<div class="outline-text-4" id="text-2-5-2">
+
+<p> An operation on a smartcard definitely failed. Currently there is
+ no indication of the actual error code, but application should be
+ prepared to later accept more arguments. Defined values for
+ &lt;code&gt; are:
+</p>
+<dl>
+<dt>0</dt><dd>unspecified error (identically to a missing CODE)
+</dd>
+<dt>1</dt><dd>canceled
+</dd>
+<dt>2</dt><dd>bad PIN
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-5-3" class="outline-4">
+<h4 id="sec-2-5-3"><span class="section-number-4">2.5.3</span> SC_OP_SUCCESS</h4>
+<div class="outline-text-4" id="text-2-5-3">
+
+<p> A smart card operaion succeeded. This status is only printed for
+ certain operation and is mostly useful to check whether a PIN
+ change really worked.
+</p>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2-6" class="outline-3">
+<h3 id="sec-2-6"><span class="section-number-3">2.6</span> Miscellaneous status codes</h3>
+<div class="outline-text-3" id="text-2-6">
+
+
+</div>
+
+<div id="outline-container-2-6-1" class="outline-4">
+<h4 id="sec-2-6-1"><span class="section-number-4">2.6.1</span> NODATA &lt;what&gt;</h4>
+<div class="outline-text-4" id="text-2-6-1">
+
+<p> No data has been found. Codes for WHAT are:
+</p>
+<dl>
+<dt>1</dt><dd>No armored data.
+</dd>
+<dt>2</dt><dd>Expected a packet but did not found one.
+</dd>
+<dt>3</dt><dd>Invalid packet found, this may indicate a non OpenPGP
+ message.
+</dd>
+<dt>4</dt><dd>Signature expected but not found
+</dd>
+</dl>
+
+
+<p>
+ You may see more than one of these status lines.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-2" class="outline-4">
+<h4 id="sec-2-6-2"><span class="section-number-4">2.6.2</span> UNEXPECTED &lt;what&gt;</h4>
+<div class="outline-text-4" id="text-2-6-2">
+
+<p> Unexpected data has been encountered. Codes for WHAT are:
+</p><dl>
+<dt>0</dt><dd>Not further specified
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-6-3" class="outline-4">
+<h4 id="sec-2-6-3"><span class="section-number-4">2.6.3</span> TRUNCATED &lt;maxno&gt;</h4>
+<div class="outline-text-4" id="text-2-6-3">
+
+<p> The output was truncated to MAXNO items. This status code is
+ issued for certain external requests.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-4" class="outline-4">
+<h4 id="sec-2-6-4"><span class="section-number-4">2.6.4</span> ERROR &lt;error location&gt; &lt;error code&gt; [&lt;more&gt;]</h4>
+<div class="outline-text-4" id="text-2-6-4">
+
+<p> This is a generic error status message, it might be followed by
+ error location specific data. &lt;error code&gt; and &lt;error_location&gt;
+ should not contain spaces. The error code is a either a string
+ commencing with a letter or such a string prefixed with a
+ numerical error code and an underscore; e.g.: "151011327_EOF".
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-5" class="outline-4">
+<h4 id="sec-2-6-5"><span class="section-number-4">2.6.5</span> SUCCESS [&lt;location&gt;]</h4>
+<div class="outline-text-4" id="text-2-6-5">
+
+<p> Postive confirimation that an operation succeeded. &lt;location&gt; is
+ optional but if given should not contain spaces. Used only with a
+ few commands.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-6" class="outline-4">
+<h4 id="sec-2-6-6"><span class="section-number-4">2.6.6</span> BADARMOR</h4>
+<div class="outline-text-4" id="text-2-6-6">
+
+<p> The ASCII armor is corrupted. No arguments yet.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-7" class="outline-4">
+<h4 id="sec-2-6-7"><span class="section-number-4">2.6.7</span> DELETE_PROBLEM &lt;reason_code&gt;</h4>
+<div class="outline-text-4" id="text-2-6-7">
+
+<p> Deleting a key failed. Reason codes are:
+</p><dl>
+<dt>1</dt><dd>No such key
+</dd>
+<dt>2</dt><dd>Must delete secret key first
+</dd>
+<dt>3</dt><dd>Ambigious specification
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-6-8" class="outline-4">
+<h4 id="sec-2-6-8"><span class="section-number-4">2.6.8</span> PROGRESS &lt;what&gt; &lt;char&gt; &lt;cur&gt; &lt;total&gt;</h4>
+<div class="outline-text-4" id="text-2-6-8">
+
+<p> Used by the primegen and Public key functions to indicate
+ progress. &lt;char&gt; is the character displayed with no &ndash;status-fd
+ enabled, with the linefeed replaced by an 'X'. &lt;cur&gt; is the
+ current amount done and &lt;total&gt; is amount to be done; a &lt;total&gt; of
+ 0 indicates that the total amount is not known. The condition
+</p><pre class="example">
+ TOTAL &amp;&amp; CUR == TOTAL
+</pre>
+
+<p> may be used to detect the end of an operation.
+</p>
+<p>
+ Well known values for WHAT are:
+</p>
+<dl>
+<dt>pk_dsa </dt><dd>DSA key generation
+</dd>
+<dt>pk_elg </dt><dd>Elgamal key generation
+</dd>
+<dt>primegen</dt><dd>Prime generation
+</dd>
+<dt>need_entropy</dt><dd>Waiting for new entropy in the RNG
+</dd>
+<dt>tick</dt><dd>Generic tick without any special meaning - useful
+ for letting clients know that the server is still
+ working.
+</dd>
+<dt>starting_agent</dt><dd>A gpg-agent was started because it is not
+ running as a daemon.
+</dd>
+<dt>learncard</dt><dd>Send by the agent and gpgsm while learing
+ the data of a smartcard.
+</dd>
+<dt>card_busy</dt><dd>A smartcard is still working
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-2-6-9" class="outline-4">
+<h4 id="sec-2-6-9"><span class="section-number-4">2.6.9</span> BACKUP_KEY_CREATED &lt;fingerprint&gt; &lt;fname&gt;</h4>
+<div class="outline-text-4" id="text-2-6-9">
+
+<p> A backup of a key identified by &lt;fingerprint&gt; has been writte to
+ the file &lt;fname&gt;; &lt;fname&gt; is percent-escaped.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-10" class="outline-4">
+<h4 id="sec-2-6-10"><span class="section-number-4">2.6.10</span> MOUNTPOINT &lt;name&gt;</h4>
+<div class="outline-text-4" id="text-2-6-10">
+
+<p> &lt;name&gt; is a percent-plus escaped filename describing the
+ mountpoint for the current operation (e.g. used by "g13 &ndash;mount").
+ This may either be the specified mountpoint or one randomly
+ choosen by g13.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-2-6-11" class="outline-4">
+<h4 id="sec-2-6-11"><span class="section-number-4">2.6.11</span> PINENTRY_LAUNCHED &lt;pid&gt;</h4>
+<div class="outline-text-4" id="text-2-6-11">
+
+<p> This status line is emitted by gpg to notify a client that a
+ Pinentry has been launched. &lt;pid&gt; is the PID of the Pinentry. It
+ may be used to display a hint to the user but can't be used to
+ synchronize with Pinentry. Note that there is also an Assuan
+ inquiry line with the same name used internally or, if enabled,
+ send to the client instead of this status line. Such an inquiry
+ may be used to sync with Pinentry
+</p>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-2-7" class="outline-3">
+<h3 id="sec-2-7"><span class="section-number-3">2.7</span> Obsolete status codes</h3>
+<div class="outline-text-3" id="text-2-7">
+
+
+</div>
+
+<div id="outline-container-2-7-1" class="outline-4">
+<h4 id="sec-2-7-1"><span class="section-number-4">2.7.1</span> SIGEXPIRED</h4>
+<div class="outline-text-4" id="text-2-7-1">
+
+<p> Removed on 2011-02-04. This is deprecated in favor of KEYEXPIRED.
+</p></div>
+
+</div>
+
+<div id="outline-container-2-7-2" class="outline-4">
+<h4 id="sec-2-7-2"><span class="section-number-4">2.7.2</span> RSA_OR_IDEA</h4>
+<div class="outline-text-4" id="text-2-7-2">
+
+<p> Obsolete. This status message used to be emitted for requests to
+ use the IDEA or RSA algorithms. It has been dropped from GnuPG
+ 2.1 after the respective patents expired.
+</p></div>
+
+</div>
+
+<div id="outline-container-2-7-3" class="outline-4">
+<h4 id="sec-2-7-3"><span class="section-number-4">2.7.3</span> SHM_INFO, SHM_GET, SHM_GET_BOOL, SHM_GET_HIDDEN</h4>
+<div class="outline-text-4" id="text-2-7-3">
+
+<p> These were used for the ancient shared memory based co-processing.
+</p></div>
+
+</div>
+
+<div id="outline-container-2-7-4" class="outline-4">
+<h4 id="sec-2-7-4"><span class="section-number-4">2.7.4</span> BEGIN_STREAM, END_STREAM</h4>
+<div class="outline-text-4" id="text-2-7-4">
+
+<p> Used to issued by the experimental pipemode.
+</p>
+
+</div>
+</div>
+</div>
+
+</div>
+
+<div id="outline-container-3" class="outline-2">
+<h2 id="sec-3"><span class="section-number-2">3</span> Format of the &ndash;attribute-fd output</h2>
+<div class="outline-text-2" id="text-3">
+
+
+<p>
+ When &ndash;attribute-fd is set, during key listings (&ndash;list-keys,
+ &ndash;list-secret-keys) GnuPG dumps each attribute packet to the file
+ descriptor specified. &ndash;attribute-fd is intended for use with
+ &ndash;status-fd as part of the required information is carried on the
+ ATTRIBUTE status tag (see above).
+</p>
+<p>
+ The contents of the attribute data is specified by RFC 4880. For
+ convenience, here is the Photo ID format, as it is currently the
+ only attribute defined:
+</p>
+<dl>
+<dt>Byte 0-1</dt><dd>The length of the image header. Due to a historical
+ accident (i.e. oops!) back in the NAI PGP days, this
+ is a little-endian number. Currently 16 (0x10 0x00).
+
+</dd>
+<dt>Byte 2</dt><dd>The image header version. Currently 0x01.
+
+</dd>
+<dt>Byte 3</dt><dd>Encoding format. 0x01 == JPEG.
+
+</dd>
+<dt>Byte 4-15</dt><dd>Reserved, and currently unused.
+</dd>
+</dl>
+
+
+<p>
+ All other data after this header is raw image (JPEG) data.
+</p>
+
+</div>
+
+</div>
+
+<div id="outline-container-4" class="outline-2">
+<h2 id="sec-4"><span class="section-number-2">4</span> Unattended key generation</h2>
+<div class="outline-text-2" id="text-4">
+
+
+<p>
+ Please see the GnuPG manual for a description.
+</p>
+
+</div>
+
+</div>
+
+<div id="outline-container-5" class="outline-2">
+<h2 id="sec-5"><span class="section-number-2">5</span> Layout of the TrustDB</h2>
+<div class="outline-text-2" id="text-5">
+
+
+<p>
+ The TrustDB is built from fixed length records, where the first byte
+ describes the record type. All numeric values are stored in network
+ byte order. The length of each record is 40 bytes. The first record
+ of the DB is always of type 1 and this is the only record of this
+ type.
+</p>
+<p>
+ FIXME: The layout changed, document it here.
+</p>
+
+
+<pre class="example">Record type 0:
+--------------
+ Unused record, can be reused for any purpose.
+
+Record type 1:
+--------------
+ Version information for this TrustDB. This is always the first
+ record of the DB and the only one with type 1.
+ 1 byte value 1
+ 3 bytes 'gpg' magic value
+ 1 byte Version of the TrustDB (2)
+ 1 byte marginals needed
+ 1 byte completes needed
+ 1 byte max_cert_depth
+ The three items are used to check whether the cached
+ validity value from the dir record can be used.
+ 1 u32 locked flags [not used]
+ 1 u32 timestamp of trustdb creation
+ 1 u32 timestamp of last modification which may affect the validity
+ of keys in the trustdb. This value is checked against the
+ validity timestamp in the dir records.
+ 1 u32 timestamp of last validation [currently not used]
+ (Used to keep track of the time, when this TrustDB was checked
+ against the pubring)
+ 1 u32 record number of keyhashtable [currently not used]
+ 1 u32 first free record
+ 1 u32 record number of shadow directory hash table [currently not used]
+ It does not make sense to combine this table with the key table
+ because the keyid is not in every case a part of the fingerprint.
+ 1 u32 record number of the trusthashtbale
+
+
+Record type 2: (directory record)
+--------------
+ Informations about a public key certificate.
+ These are static values which are never changed without user interaction.
+
+ 1 byte value 2
+ 1 byte reserved
+ 1 u32 LID . (This is simply the record number of this record.)
+ 1 u32 List of key-records (the first one is the primary key)
+ 1 u32 List of uid-records
+ 1 u32 cache record
+ 1 byte ownertrust
+ 1 byte dirflag
+ 1 byte maximum validity of all the user ids
+ 1 u32 time of last validity check.
+ 1 u32 Must check when this time has been reached.
+ (0 = no check required)
+
+
+Record type 3: (key record)
+--------------
+ Informations about a primary public key.
+ (This is mainly used to lookup a trust record)
+
+ 1 byte value 3
+ 1 byte reserved
+ 1 u32 LID
+ 1 u32 next - next key record
+ 7 bytes reserved
+ 1 byte keyflags
+ 1 byte pubkey algorithm
+ 1 byte length of the fingerprint (in bytes)
+ 20 bytes fingerprint of the public key
+ (This is the value we use to identify a key)
+
+Record type 4: (uid record)
+--------------
+ Informations about a userid
+ We do not store the userid but the hash value of the userid because that
+ is sufficient.
+
+ 1 byte value 4
+ 1 byte reserved
+ 1 u32 LID points to the directory record.
+ 1 u32 next next userid
+ 1 u32 pointer to preference record
+ 1 u32 siglist list of valid signatures
+ 1 byte uidflags
+ 1 byte validity of the key calculated over this user id
+ 20 bytes ripemd160 hash of the username.
+
+
+Record type 5: (pref record)
+--------------
+ This record type is not anymore used.
+
+ 1 byte value 5
+ 1 byte reserved
+ 1 u32 LID; points to the directory record (and not to the uid record!).
+ (or 0 for standard preference record)
+ 1 u32 next
+ 30 byte preference data
+
+Record type 6 (sigrec)
+-------------
+ Used to keep track of key signatures. Self-signatures are not
+ stored. If a public key is not in the DB, the signature points to
+ a shadow dir record, which in turn has a list of records which
+ might be interested in this key (and the signature record here
+ is one).
+
+ 1 byte value 6
+ 1 byte reserved
+ 1 u32 LID points back to the dir record
+ 1 u32 next next sigrec of this uid or 0 to indicate the
+ last sigrec.
+ 6 times
+ 1 u32 Local_id of signatures dir or shadow dir record
+ 1 byte Flag: Bit 0 = checked: Bit 1 is valid (we have a real
+ directory record for this)
+ 1 = valid is set (but may be revoked)
+
+
+
+Record type 8: (shadow directory record)
+--------------
+ This record is used to reserve a LID for a public key. We
+ need this to create the sig records of other keys, even if we
+ do not yet have the public key of the signature.
+ This record (the record number to be more precise) will be reused
+ as the dir record when we import the real public key.
+
+ 1 byte value 8
+ 1 byte reserved
+ 1 u32 LID (This is simply the record number of this record.)
+ 2 u32 keyid
+ 1 byte pubkey algorithm
+ 3 byte reserved
+ 1 u32 hintlist A list of records which have references to
+ this key. This is used for fast access to
+ signature records which are not yet checked.
+ Note, that this is only a hint and the actual records
+ may not anymore hold signature records for that key
+ but that the code cares about this.
+ 18 byte reserved
+
+
+
+Record Type 10 (hash table)
+--------------
+ Due to the fact that we use fingerprints to lookup keys, we can
+ implement quick access by some simple hash methods, and avoid
+ the overhead of gdbm. A property of fingerprints is that they can be
+ used directly as hash values. (They can be considered as strong
+ random numbers.)
+ What we use is a dynamic multilevel architecture, which combines
+ hashtables, record lists, and linked lists.
+
+ This record is a hashtable of 256 entries; a special property
+ is that all these records are stored consecutively to make one
+ big table. The hash value is simple the 1st, 2nd, ... byte of
+ the fingerprint (depending on the indirection level).
+
+ When used to hash shadow directory records, a different table is used
+ and indexed by the keyid.
+
+ 1 byte value 10
+ 1 byte reserved
+ n u32 recnum; n depends on the record length:
+ n = (reclen-2)/4 which yields 9 for the current record length
+ of 40 bytes.
+
+ the total number of such record which makes up the table is:
+ m = (256+n-1) / n
+ which is 29 for a record length of 40.
+
+ To look up a key we use the first byte of the fingerprint to get
+ the recnum from this hashtable and look up the addressed record:
+ - If this record is another hashtable, we use 2nd byte
+ to index this hash table and so on.
+ - if this record is a hashlist, we walk all entries
+ until we found one a matching one.
+ - if this record is a key record, we compare the
+ fingerprint and to decide whether it is the requested key;
+
+
+Record type 11 (hash list)
+--------------
+ see hash table for an explanation.
+ This is also used for other purposes.
+
+ 1 byte value 11
+ 1 byte reserved
+ 1 u32 next next hash list record
+ n times n = (reclen-5)/5
+ 1 u32 recnum
+
+ For the current record length of 40, n is 7
+
+
+
+Record type 254 (free record)
+---------------
+ All these records form a linked list of unused records.
+ 1 byte value 254
+ 1 byte reserved (0)
+ 1 u32 next_free
+</pre>
+
+
+
+</div>
+
+</div>
+
+<div id="outline-container-6" class="outline-2">
+<h2 id="sec-6"><span class="section-number-2">6</span> GNU extensions to the S2K algorithm</h2>
+<div class="outline-text-2" id="text-6">
+
+
+<p>
+ S2K mode 101 is used to identify these extensions.
+ After the hash algorithm the 3 bytes "GNU" are used to make
+ clear that these are extensions for GNU, the next bytes gives the
+ GNU protection mode - 1000. Defined modes are:
+</p><dl>
+<dt>1001</dt><dd>Do not store the secret part at all.
+</dd>
+<dt>1002</dt><dd>A stub to access smartcards (not used in 1.2.x)
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-7" class="outline-2">
+<h2 id="sec-7"><span class="section-number-2">7</span> Keyserver helper message format</h2>
+<div class="outline-text-2" id="text-7">
+
+
+<p>
+ The keyserver may be contacted by a Unix Domain socket or via TCP.
+</p>
+<p>
+ The format of a request is:
+</p>
+
+
+<pre class="example">command-tag
+"Content-length:" digits
+CRLF
+</pre>
+
+
+<p>
+ Where command-tag is
+</p>
+
+
+
+<pre class="example">NOOP
+GET &lt;user-name&gt;
+PUT
+DELETE &lt;user-name&gt;
+</pre>
+
+
+<p>
+The format of a response is:
+</p>
+
+
+
+<pre class="example">"GNUPG/1.0" status-code status-text
+"Content-length:" digits
+CRLF
+</pre>
+
+<p>
+followed by &lt;digits&gt; bytes of data
+</p>
+<p>
+Status codes are:
+</p>
+<dl>
+<dt>1xx</dt><dd>Informational - Request received, continuing process
+
+</dd>
+<dt>2xx</dt><dd>Success - The action was successfully received, understood,
+ and accepted
+
+</dd>
+<dt>4xx</dt><dd>Client Error - The request contains bad syntax or cannot be
+ fulfilled
+
+</dd>
+<dt>5xx</dt><dd>Server Error - The server failed to fulfill an apparently
+ valid request
+</dd>
+</dl>
+
+
+
+</div>
+
+</div>
+
+<div id="outline-container-8" class="outline-2">
+<h2 id="sec-8"><span class="section-number-2">8</span> Object identifiers</h2>
+<div class="outline-text-2" id="text-8">
+
+
+<p>
+ OIDs below the GnuPG arc:
+</p>
+
+
+
+<pre class="example">1.3.6.1.4.1.11591.2 GnuPG
+1.3.6.1.4.1.11591.2.1 notation
+1.3.6.1.4.1.11591.2.1.1 pkaAddress
+1.3.6.1.4.1.11591.2.2 X.509 extensions
+1.3.6.1.4.1.11591.2.2.1 standaloneCertificate
+1.3.6.1.4.1.11591.2.2.2 wellKnownPrivateKey
+1.3.6.1.4.1.11591.2.12242973 invalid encoded OID
+</pre>
+
+
+
+
+</div>
+
+</div>
+
+<div id="outline-container-9" class="outline-2">
+<h2 id="sec-9"><span class="section-number-2">9</span> Miscellaneous notes</h2>
+<div class="outline-text-2" id="text-9">
+
+
+
+</div>
+
+<div id="outline-container-9-1" class="outline-3">
+<h3 id="sec-9-1"><span class="section-number-3">9.1</span> v3 fingerprints</h3>
+<div class="outline-text-3" id="text-9-1">
+
+<p> For packet version 3 we calculate the keyids this way:
+</p><dl>
+<dt>RSA</dt><dd>Low 64 bits of n
+</dd>
+<dt>ELGAMAL</dt><dd>Build a v3 pubkey packet (with CTB 0x99) and
+ calculate a RMD160 hash value from it. This is used
+ as the fingerprint and the low 64 bits are the keyid.
+</dd>
+</dl>
+
+
+</div>
+
+</div>
+
+<div id="outline-container-9-2" class="outline-3">
+<h3 id="sec-9-2"><span class="section-number-3">9.2</span> Simplified revocation certificates</h3>
+<div class="outline-text-3" id="text-9-2">
+
+<p> Revocation certificates consist only of the signature packet;
+ "&ndash;import" knows how to handle this. The rationale behind it is to
+ keep them small.
+</p>
+</div>
+
+</div>
+
+<div id="outline-container-9-3" class="outline-3">
+<h3 id="sec-9-3"><span class="section-number-3">9.3</span> Documentation on HKP (the http keyserver protocol):</h3>
+<div class="outline-text-3" id="text-9-3">
+
+
+<p>
+ A minimalistic HTTP server on port 11371 recognizes a GET for
+ /pks/lookup. The standard http URL encoded query parameters are
+ this (always key=value):
+</p>
+<ul>
+<li>op=index (like pgp -kv), op=vindex (like pgp -kvv) and op=get (like
+ pgp -kxa)
+
+</li>
+<li>search=&lt;stringlist&gt;. This is a list of words that must occur in the key.
+ The words are delimited with space, points, @ and so on. The delimiters
+ are not searched for and the order of the words doesn't matter (but see
+ next option).
+
+</li>
+<li>exact=on. This switch tells the hkp server to only report exact matching
+ keys back. In this case the order and the "delimiters" are important.
+
+</li>
+<li>fingerprint=on. Also reports the fingerprints when used with 'index' or
+ 'vindex'
+</li>
+</ul>
+
+
+<p>
+ The keyserver also recognizes http-POSTs to /pks/add. Use this to upload
+ keys.
+</p>
+
+<p>
+ A better way to do this would be a request like:
+</p>
+<p>
+ /pks/lookup/&lt;gnupg_formatierte_user_id&gt;?op=&lt;operation&gt;
+</p>
+<p>
+ This can be implemented using Hurd's translator mechanism.
+ However, I think the whole key server stuff has to be re-thought;
+ I have some ideas and probably create a white paper.
+</p></div>
+</div>
+</div>
+</div>
+
+<div id="postamble">
+<p class="date">Date: 2013-07-03T09:52+0000</p>
+<p class="author">Author: isis</p>
+<p class="email"><a href="mailto:isis@wintermute.patternsinthevoid.net">isis@wintermute.patternsinthevoid.net</a></p>
+<p class="creator"><a href="http://orgmode.org">Org</a> version 7.9.2 with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24</p>
+<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
+
+</div>
+</body>
+</html>
diff --git a/docs/_build/html/_static/agogo.css b/docs/_build/html/_static/agogo.css
new file mode 100644
index 0000000..2bdc26f
--- /dev/null
+++ b/docs/_build/html/_static/agogo.css
@@ -0,0 +1,337 @@
+* {
+ margin: 0px;
+ padding: 0px;
+}
+
+body {
+ font-family: "Verdana", Arial, sans-serif;
+ line-height: 1.4em;
+ font-size: 14px;
+ color: black;
+ background-color: #eeeeec;
+}
+
+
+/* Page layout */
+
+div.header, div.content, div.footer {
+ width: 70em;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+div.header-wrapper {
+ background: url(bgtop.png) top left repeat-x;
+ border-bottom: 3px solid #2e3436;
+}
+
+div.headertitle a {
+ font-family: "Georgia", "Times New Roman", serif;
+ font-size: 2em;
+ color: rgb(252, 175, 62);
+ font-weight: normal;
+}
+
+h1 {
+ color: #204a87;
+}
+
+/* Default body styles */
+a {
+ text-decoration: none;
+ color: #ce5c00;
+}
+
+.clearer {
+ clear: both;
+}
+
+.left {
+ float: left;
+}
+
+.right {
+ float: right;
+}
+
+h1, h2, h3, h4 {
+ font-family: "Georgia", "Times New Roman", serif;
+ font-weight: normal;
+ color: #3465a4;
+ margin-bottom: .8em;
+}
+
+h1 {
+ color: #204a87;
+}
+
+h2 {
+ padding-bottom: .5em;
+ border-bottom: 1px solid #3465a4;
+}
+
+a.headerlink {
+ visibility: hidden;
+ color: #dddddd;
+ padding-left: .3em;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+
+
+/* Header */
+
+div.header {
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+div.header h1 {
+ font-family: "Georgia", "Times New Roman", serif;
+ font-weight: normal;
+ font-size: 160%;
+ letter-spacing: .08em;
+}
+
+div.header h1 a {
+ color: white;
+}
+
+div.header div.rel {
+ margin-top: 1em;
+}
+
+div.header div.rel a {
+ color: #fcaf3e;
+ letter-spacing: .1em;
+ text-transform: uppercase;
+}
+
+
+/* Content */
+div.content-wrapper {
+ background-color: white;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+div.document {
+ width: 50em;
+ float: left;
+}
+
+div.body {
+ padding-right: 2em;
+ text-align: justify;
+}
+
+div.document ul {
+ margin-left: 1.2em;
+ list-style-type: square;
+}
+
+div.document dd {
+ margin-left: 1.2em;
+ margin-top: .4em;
+ margin-bottom: 1em;
+}
+
+div.document .section {
+ margin-top: 1.7em;
+}
+div.document .section:first-child {
+ margin-top: 0px;
+}
+
+div.document div.highlight {
+ padding: 3px;
+ background-color: #eeeeec;
+ border-top: 2px solid #dddddd;
+ border-bottom: 2px solid #dddddd;
+ margin-top: .8em;
+ margin-bottom: .8em;
+}
+
+div.document h2 {
+ margin-top: .7em;
+}
+
+div.document p {
+ margin-bottom: .5em;
+}
+
+div.document li.toctree-l1 {
+ margin-bottom: 1em;
+}
+
+div.document .descname {
+ font-weight: bold;
+}
+
+div.document .docutils.literal {
+ background-color: #eeeeec;
+ padding: 1px;
+}
+
+div.document .docutils.xref.literal {
+ background-color: transparent;
+ padding: 0px;
+}
+
+
+/* Sidebar */
+
+div.sidebar {
+ width: 20em;
+ float: right;
+ font-size: .9em;
+}
+
+div.sidebar h3 {
+ color: #2e3436;
+ text-transform: uppercase;
+ font-size: 130%;
+ letter-spacing: .1em;
+}
+
+div.sidebar ul {
+ list-style-type: none;
+}
+
+div.sidebar li.toctree-l1 a {
+ display: block;
+ padding: 1px;
+ border: 1px solid #dddddd;
+ background-color: #eeeeec;
+ margin-bottom: .4em;
+ padding-left: 3px;
+ color: #2e3436;
+}
+
+div.sidebar li.toctree-l2 a {
+ background-color: transparent;
+ border: none;
+ border-bottom: 1px solid #dddddd;
+}
+
+div.sidebar li.toctree-l2:last-child a {
+ border-bottom: none;
+}
+
+div.sidebar li.toctree-l1.current a {
+ border-right: 5px solid #fcaf3e;
+}
+
+div.sidebar li.toctree-l1.current li.toctree-l2 a {
+ border-right: none;
+}
+
+
+/* Footer */
+
+div.footer-wrapper {
+ background: url(bgfooter.png) top left repeat-x;
+ border-top: 4px solid #babdb6;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ min-height: 80px;
+}
+
+div.footer, div.footer a {
+ color: #888a85;
+}
+
+div.footer .right {
+ text-align: right;
+}
+
+div.footer .left {
+ text-transform: uppercase;
+}
+
+
+/* Styles copied form basic theme */
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
diff --git a/docs/_build/html/_static/ajax-loader.gif b/docs/_build/html/_static/ajax-loader.gif
new file mode 100644
index 0000000..61faf8c
--- /dev/null
+++ b/docs/_build/html/_static/ajax-loader.gif
Binary files differ
diff --git a/docs/_build/html/_static/basic.css b/docs/_build/html/_static/basic.css
new file mode 100644
index 0000000..8f37fb2
--- /dev/null
+++ b/docs/_build/html/_static/basic.css
@@ -0,0 +1,537 @@
+/*
+ * basic.css
+ * ~~~~~~~~~
+ *
+ * Sphinx stylesheet -- basic theme.
+ *
+ * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.clearer {
+ clear: both;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+ width: 100%;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 300px;
+ margin-left: -100%;
+ font-size: 90%;
+}
+
+div.sphinxsidebar ul {
+ list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+ width: 170px;
+}
+
+div.sphinxsidebar #searchbox input[type="submit"] {
+ width: 30px;
+}
+
+img {
+ border: 0;
+ max-width: 100%;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable {
+ width: 100%;
+}
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+div.modindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+a.headerlink {
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+.field-list ul {
+ padding-left: 1em;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+img.align-left, .figure.align-left, object.align-left {
+ clear: left;
+ float: left;
+ margin-right: 1em;
+}
+
+img.align-right, .figure.align-right, object.align-right {
+ clear: right;
+ float: right;
+ margin-left: 1em;
+}
+
+img.align-center, .figure.align-center, object.align-center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.align-right {
+ text-align: right;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar {
+ margin: 0 0 0.5em 1em;
+ border: 1px solid #ddb;
+ padding: 7px 7px 0 7px;
+ background-color: #ffe;
+ width: 40%;
+ float: right;
+}
+
+p.sidebar-title {
+ font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+div.topic {
+ border: 1px solid #ccc;
+ padding: 7px 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 5px;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px;
+}
+
+table.citation td {
+ border-bottom: none;
+}
+
+/* -- other body styles ----------------------------------------------------- */
+
+ol.arabic {
+ list-style: decimal;
+}
+
+ol.loweralpha {
+ list-style: lower-alpha;
+}
+
+ol.upperalpha {
+ list-style: upper-alpha;
+}
+
+ol.lowerroman {
+ list-style: lower-roman;
+}
+
+ol.upperroman {
+ list-style: upper-roman;
+}
+
+dl {
+ margin-bottom: 15px;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+dt:target, .highlighted {
+ background-color: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+.footnote:target {
+ background-color: #ffa;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+.guilabel, .menuselection {
+ font-family: sans-serif;
+}
+
+.accelerator {
+ text-decoration: underline;
+}
+
+.classifier {
+ font-style: oblique;
+}
+
+abbr, acronym {
+ border-bottom: dotted 1px;
+ cursor: help;
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+ overflow: auto;
+ overflow-y: hidden; /* fixes display issues on Chrome browsers */
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+tt.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+tt.descclassname {
+ background-color: transparent;
+}
+
+tt.xref, a tt {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+ background-color: transparent;
+}
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+ margin: -1px -10px;
+ padding: 0 10px;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.body div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+/* -- printout stylesheet --------------------------------------------------- */
+
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0 !important;
+ width: 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ #top-link {
+ display: none;
+ }
+} \ No newline at end of file
diff --git a/docs/_build/html/_static/bgfooter.png b/docs/_build/html/_static/bgfooter.png
new file mode 100644
index 0000000..9ce5bdd
--- /dev/null
+++ b/docs/_build/html/_static/bgfooter.png
Binary files differ
diff --git a/docs/_build/html/_static/bgtop.png b/docs/_build/html/_static/bgtop.png
new file mode 100644
index 0000000..a0d4709
--- /dev/null
+++ b/docs/_build/html/_static/bgtop.png
Binary files differ
diff --git a/docs/_build/html/_static/comment-bright.png b/docs/_build/html/_static/comment-bright.png
new file mode 100644
index 0000000..551517b
--- /dev/null
+++ b/docs/_build/html/_static/comment-bright.png
Binary files differ
diff --git a/docs/_build/html/_static/comment-close.png b/docs/_build/html/_static/comment-close.png
new file mode 100644
index 0000000..09b54be
--- /dev/null
+++ b/docs/_build/html/_static/comment-close.png
Binary files differ
diff --git a/docs/_build/html/_static/comment.png b/docs/_build/html/_static/comment.png
new file mode 100644
index 0000000..92feb52
--- /dev/null
+++ b/docs/_build/html/_static/comment.png
Binary files differ
diff --git a/docs/_build/html/_static/doctools.js b/docs/_build/html/_static/doctools.js
new file mode 100644
index 0000000..c5455c9
--- /dev/null
+++ b/docs/_build/html/_static/doctools.js
@@ -0,0 +1,238 @@
+/*
+ * doctools.js
+ * ~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilities for all documentation.
+ *
+ * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/**
+ * select a different prefix for underscore
+ */
+$u = _.noConflict();
+
+/**
+ * make the code below compatible with browsers without
+ * an installed firebug like debugger
+if (!window.console || !console.firebug) {
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
+ "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
+ "profile", "profileEnd"];
+ window.console = {};
+ for (var i = 0; i < names.length; ++i)
+ window.console[names[i]] = function() {};
+}
+ */
+
+/**
+ * small helper function to urldecode strings
+ */
+jQuery.urldecode = function(x) {
+ return decodeURIComponent(x).replace(/\+/g, ' ');
+};
+
+/**
+ * small helper function to urlencode strings
+ */
+jQuery.urlencode = encodeURIComponent;
+
+/**
+ * This function returns the parsed url parameters of the
+ * current request. Multiple values per key are supported,
+ * it will always return arrays of strings for the value parts.
+ */
+jQuery.getQueryParameters = function(s) {
+ if (typeof s == 'undefined')
+ s = document.location.search;
+ var parts = s.substr(s.indexOf('?') + 1).split('&');
+ var result = {};
+ for (var i = 0; i < parts.length; i++) {
+ var tmp = parts[i].split('=', 2);
+ var key = jQuery.urldecode(tmp[0]);
+ var value = jQuery.urldecode(tmp[1]);
+ if (key in result)
+ result[key].push(value);
+ else
+ result[key] = [value];
+ }
+ return result;
+};
+
+/**
+ * highlight a given string on a jquery object by wrapping it in
+ * span elements with the given class name.
+ */
+jQuery.fn.highlightText = function(text, className) {
+ function highlight(node) {
+ if (node.nodeType == 3) {
+ var val = node.nodeValue;
+ var pos = val.toLowerCase().indexOf(text);
+ if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
+ var span = document.createElement("span");
+ span.className = className;
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ node.parentNode.insertBefore(span, node.parentNode.insertBefore(
+ document.createTextNode(val.substr(pos + text.length)),
+ node.nextSibling));
+ node.nodeValue = val.substr(0, pos);
+ }
+ }
+ else if (!jQuery(node).is("button, select, textarea")) {
+ jQuery.each(node.childNodes, function() {
+ highlight(this);
+ });
+ }
+ }
+ return this.each(function() {
+ highlight(this);
+ });
+};
+
+/**
+ * Small JavaScript module for the documentation.
+ */
+var Documentation = {
+
+ init : function() {
+ this.fixFirefoxAnchorBug();
+ this.highlightSearchWords();
+ this.initIndexTable();
+ },
+
+ /**
+ * i18n support
+ */
+ TRANSLATIONS : {},
+ PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
+ LOCALE : 'unknown',
+
+ // gettext and ngettext don't access this so that the functions
+ // can safely bound to a different name (_ = Documentation.gettext)
+ gettext : function(string) {
+ var translated = Documentation.TRANSLATIONS[string];
+ if (typeof translated == 'undefined')
+ return string;
+ return (typeof translated == 'string') ? translated : translated[0];
+ },
+
+ ngettext : function(singular, plural, n) {
+ var translated = Documentation.TRANSLATIONS[singular];
+ if (typeof translated == 'undefined')
+ return (n == 1) ? singular : plural;
+ return translated[Documentation.PLURALEXPR(n)];
+ },
+
+ addTranslations : function(catalog) {
+ for (var key in catalog.messages)
+ this.TRANSLATIONS[key] = catalog.messages[key];
+ this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
+ this.LOCALE = catalog.locale;
+ },
+
+ /**
+ * add context elements like header anchor links
+ */
+ addContextElements : function() {
+ $('div[id] > :header:first').each(function() {
+ $('<a class="headerlink">\u00B6</a>').
+ attr('href', '#' + this.id).
+ attr('title', _('Permalink to this headline')).
+ appendTo(this);
+ });
+ $('dt[id]').each(function() {
+ $('<a class="headerlink">\u00B6</a>').
+ attr('href', '#' + this.id).
+ attr('title', _('Permalink to this definition')).
+ appendTo(this);
+ });
+ },
+
+ /**
+ * workaround a firefox stupidity
+ */
+ fixFirefoxAnchorBug : function() {
+ if (document.location.hash && $.browser.mozilla)
+ window.setTimeout(function() {
+ document.location.href += '';
+ }, 10);
+ },
+
+ /**
+ * highlight the search words provided in the url in the text
+ */
+ highlightSearchWords : function() {
+ var params = $.getQueryParameters();
+ var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
+ if (terms.length) {
+ var body = $('div.body');
+ if (!body.length) {
+ body = $('body');
+ }
+ window.setTimeout(function() {
+ $.each(terms, function() {
+ body.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ }, 10);
+ $('<p class="highlight-link"><a href="javascript:Documentation.' +
+ 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
+ .appendTo($('#searchbox'));
+ }
+ },
+
+ /**
+ * init the domain index toggle buttons
+ */
+ initIndexTable : function() {
+ var togglers = $('img.toggler').click(function() {
+ var src = $(this).attr('src');
+ var idnum = $(this).attr('id').substr(7);
+ $('tr.cg-' + idnum).toggle();
+ if (src.substr(-9) == 'minus.png')
+ $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
+ else
+ $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
+ }).css('display', '');
+ if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
+ togglers.click();
+ }
+ },
+
+ /**
+ * helper function to hide the search marks again
+ */
+ hideSearchWords : function() {
+ $('#searchbox .highlight-link').fadeOut(300);
+ $('span.highlighted').removeClass('highlighted');
+ },
+
+ /**
+ * make the url absolute
+ */
+ makeURL : function(relativeURL) {
+ return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
+ },
+
+ /**
+ * get the current relative url
+ */
+ getCurrentURL : function() {
+ var path = document.location.pathname;
+ var parts = path.split(/\//);
+ $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
+ if (this == '..')
+ parts.pop();
+ });
+ var url = parts.join('/');
+ return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
+ }
+};
+
+// quick alias for translations
+_ = Documentation.gettext;
+
+$(document).ready(function() {
+ Documentation.init();
+});
diff --git a/docs/_build/html/_static/down-pressed.png b/docs/_build/html/_static/down-pressed.png
new file mode 100644
index 0000000..6f7ad78
--- /dev/null
+++ b/docs/_build/html/_static/down-pressed.png
Binary files differ
diff --git a/docs/_build/html/_static/down.png b/docs/_build/html/_static/down.png
new file mode 100644
index 0000000..3003a88
--- /dev/null
+++ b/docs/_build/html/_static/down.png
Binary files differ
diff --git a/docs/_build/html/_static/file.png b/docs/_build/html/_static/file.png
new file mode 100644
index 0000000..d18082e
--- /dev/null
+++ b/docs/_build/html/_static/file.png
Binary files differ
diff --git a/docs/_build/html/_static/jquery.js b/docs/_build/html/_static/jquery.js
new file mode 100644
index 0000000..83589da
--- /dev/null
+++ b/docs/_build/html/_static/jquery.js
@@ -0,0 +1,2 @@
+/*! jQuery v1.8.3 jquery.com | jquery.org/license */
+(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file
diff --git a/docs/_build/html/_static/minus.png b/docs/_build/html/_static/minus.png
new file mode 100644
index 0000000..da1c562
--- /dev/null
+++ b/docs/_build/html/_static/minus.png
Binary files differ
diff --git a/docs/_build/html/_static/pgp-subkeys.html b/docs/_build/html/_static/pgp-subkeys.html
new file mode 100644
index 0000000..2fc83b4
--- /dev/null
+++ b/docs/_build/html/_static/pgp-subkeys.html
@@ -0,0 +1,236 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html><head><title>Using multiple subkeys in GPG</title></head><body style="background-color: white;">
+<div>[ <a href="http://fortytwo.ch/">main gpg page</a> ]
+<hr>
+<h1>Using multiple subkeys in GPG</h1>
+<hr>
+<h2>Motivation</h2>
+<p>
+For a time, I've had two different gpg keys - one at home on my presumably
+secure machine, one at the office, with NFS mounted home directory and
+quite a few people having accounts everywhere. This worked, but the problem
+is that when exchanging key signatures I always had to beg people to sign
+both my keys.
+</p>
+<p>
+With gpg and the possibility of having multiple subkeys, I can now have
+only one key, but still retain the security feature that I don't have to
+revoke my primary key (and lose all signatures on it) if the key at the
+office is compromised.
+</p>
+<p>
+<b>NOTE:</b> Most of the following can apply to both signing and encrypting
+subkeys. Encryption subkeys can not be used to solve the multiple accounts
+problem, though, please see the <a href="#problems">Problems</a> section
+further down. Also, note that I don't use multiple encryption subkeys, so I
+don't know if there are additional problems with them.
+</p>
+<p>
+The following is based on <b>gnupg 1.2.1</b>. It should all work with newer
+versions, too. Older versions do not support everything and have some
+additional problems. As I really do recommend you use a recent gpg version, I
+have omitted anything related to older gpg versions.
+</p>
+<h2>Basics</h2>
+<p>
+Generate a normal key pair, or use an existing key. Usually this will be a
+DSA/ElGamal key (this is what I use), but using RSA or other keys is
+equally possible. Be sure to do this on a 'really secure' machine.
+</p>
+<p>
+Then "<tt>gpg __edit <i>keyid</i></tt>" the key and add a further subkey
+using "<tt>addkey</tt>". "<tt>save</tt>" will store the new subkey on the
+keyring. You'll want to save the whole key (secret and public) with
+"<tt>gpg __export <i>keyid</i> &gt; pubkey</tt>" and "<tt>gpg
+__export-secret-key <i>keyid</i> &gt; seckey</tt>". Best copy those files
+onto an offline storage, too. (A basic working knowledge of how to use a
+command line and how to deal with files is assumed. Also, you should know
+a bit how key handling in gpg works. If you can't see what the above commands
+do, you better do <a href="http://www.gnupg.org/gph/en/manual.html">some
+reading</a> before continuing here).
+</p>
+<p>
+Now you should also <b>back up your keyrings</b>, as the following has to
+work on a keyring to work around some missing or broken gpg features.
+</p>
+<p>
+As you probably will only take one of the subkeys to your not-so-secure
+location, "<tt>gpg __edit <i>keyid</i></tt> and delete the subkeys you
+don't want to expose (mark them with "<tt>key <i>n</i></tt>" and then delete
+them with "<tt>delkey</tt>").
+</p>
+<p>
+"<tt>gpg __export-secret-subkeys <i>keyid</i> &gt; crippled.seckey</tt>"
+will then export the remaining subkeys, without the keymaterial of the
+primary key.
+</p>
+<p>
+Now, you can restore the keyrings (secret <em>and</em> public, since
+deleting the subkeys has also deleted the public subkeys!), and your secure
+machine is ready to use. Perhaps you don't want to use your 'insecure'
+subkey on your secure machine - again, "<tt>gpg __edit <i>keyid</i></tt>",
+"<tt>key <i>n</i></tt>" and "<tt>delkey</tt>" takes care of this; again, it
+is necessary to re-import the public key.
+</p>
+<p>
+On your 'insecure' machine, you do "<tt>gpg __import pubkey
+crippled.seckey</tt>" (the same files you've generated above), now you're ready
+to use gpg on the 'insecure' machine. To verify that you really don't have any
+secret keys you don't want, have a look at the output of "<tt>gpg
+__list-secret-keys</tt>": all primary secret key where the key material is not
+present are marked with '#'.
+</p>
+<pre>
+$ gpg __list-secret-key testuser
+sec<b>#</b> 1024D/971B7A70 2003-01-03 testuser &lt;testuser@mydomain.foo&gt;
+ssb 1024g/ACDF80C4 2003-01-03
+ssb 1024R/BE9CA308 2003-01-07
+</pre>
+<p>
+Of course, you'll have to publish your new public key, so people can
+verify your signatures and send you encrypted mail. Read the <a
+href="#problems">Problems</a> section for a few comments about this.
+</p>
+<h2>Effects</h2>
+<p>
+Keys are always signed with your primary key, so you (or any attacker) won't be
+able to sign other keys with the key on the 'insecure' machine. This is why we
+started doing all this acrobatics after all. </p>
+<p>
+You will always be able to revoke a subkey (just "<tt>gpg __edit
+<i>keyid</i></tt>", "<tt>key <i>n</i></tt>" and "<tt>revkey</tt>") when you
+have the primary secret key available, even if you lose your secret subkey.
+Meaning: you may use a secret subkey at an office location, and it is not
+strictly necessary to back it up on a secure location (It's still a good idea,
+though). The reason for this is that a revocation is really a signature on the
+subkey - and this signature is done with the primary key. Of course, this means
+that you can't revoke a subkey when you don't have the primary secret key.
+</p>
+<p>
+If you're signing documents, gpg will always try to use a subkey if one
+is available, and announce this with a message like "<tt>1024-bit DSA key, ID
+E5A7F7D6, created 2002-08-22 (main key ID 92082481)</tt>" . Verifying such
+signatures used to cause a similar message, but at least with gpg 1.2.3 no
+indication is given that the signature was made with a subkey. If you want to
+use a specific subkey (or the primary key), you have to specify it with the
+"<tt><i>keyid</i>!</tt>" syntax. I don't remember what happens if more than one
+signing subkey is available; I'm sure you can find details on this somewhere in
+the <a href="http://www.gnupg.org/documentation/mailing-lists.html">gnupg
+mailing list archives</a>.
+</p>
+<h2><a name="problems">Problems</a></h2>
+<p>
+The above approach has several problems that may lead to you not doing
+things like this. <b>These are not just possible problems. These are real,
+and <em>will</em> affect you! You have been warned.</b>
+</p>
+<p>
+First, distributing secret subkeys this way (one subkey for each
+account/machine you use) only makes sense with signing subkeys. You can have
+multiple encryption subkeys, but you can't force people sending you encrypted
+mail using a specific subkey. Naturally, if you're using encryption for
+yourself, you can chose the encryption key to use with the
+"<tt><i>keyid</i>!</tt>" syntax. The presence of multiple encryption subkeys
+is, however, useful if you revoke an older one to replace it with a new one.
+</p>
+<p>
+Old PGP versions apparently can't cope with such keys. I didn't verify this
+myself, but people on the gnupg-users mailing list said that current PGP
+versions (up to 7.x) can not verify signatures from a subkey. With PGP 8 the
+situation is a bit more complicated: PGP 8 can verify subkey signatures, but
+has still problems with multiple subkeys: a key with a signing subkey that is
+newer than the encryption subkey cannot be used for encryption in PGP 8. A key
+where the encryption subkey is newer than the signing subkey can be used for
+encryption. So, when you create your key, generate it as 'signing only' key
+first, then generate all the signing subkeys you need, and in the end generate
+the encryption subkey. (Thanks to David Shaw for this info).
+</p>
+<p>
+Most keyservers can not handle keys with multiple subkeys. Some of them even
+make these keys unusable. This should get better soon, as JHarris has written a
+patch for the pks keyserver, and keyservers with other software that handles
+this are deployed more widely. The keyservers that can handle multiple subkeys
+are summarized as <tt>subkeys.pgp.net</tt>.
+GnuPG 1.2 added code to recover somewhat when a broken key is retrieved - one
+of the subkeys is useable (the others can't be used, as the signature binding
+the subkey to the primary is lost).
+</p>
+<p>
+Besides corrupting keys with multiple subkeys, all of these old keyservers
+will also only search keys based on the primary key id - so, automatic key
+retrieval on signature verification will not work, too. Yet another
+reason to oonly use the subkeys.pgp.net keyservers.
+</p>
+<p>
+Finally, keyhandling is not comfortable with such keys - the user interface of
+gpg could be better. The following is valid for gpg 1.2.1, some things may be
+fixed in newer versions.:
+</p>
+<ul>
+<li>
+"<tt>gpg __import <i>secret key</i></tt>" does not merge the keys properly.
+If a secret key is already present, additional secret subkeys are not
+imported. Also, a dummy primary key is not replaced by the real subkey on
+import. Workaround is to shuffle around the keyrings, or do
+"<tt>__export</tt>"s at all stages and use "<tt>__delete-secret-key</tt>"
+often. (People with masochistic inclination may probably also use
+combinations of <tt>gpgsplit</tt>, <tt>cat</tt> and "<tt>gpg __export</tt>"
+and "<tt>__import</tt>. I've not tried this.)
+</li>
+<li>
+"<tt>gpg __export-secret-key <i>keyid</i>!</tt>" and <tt>gpg
+__export-secret-subkeys <i>keyid</i>!</tt>" should really only export the
+named subkey (or the primary stripped of all subkeys). Much keyring shuffling
+could be avoided. (<b>2003-02-12:</b>David Shaw added this to the development
+branch of the gpg code. Great!)
+</li>
+</ul>
+<h2>Links</h2>
+<p>
+Some additional reading that might be interesting:
+</p>
+<ul>
+<li>
+The <a href="http://www.ietf.org/rfc/rfc2440.txt">rfc2440</a>, specifying
+the OpenPGP key format.
+</li>
+<li>
+The <a href="http://www.gnupg.org/gph/en/manual.html">GNU Privacy Handbook</a>
+is a fairly complete manual to gpg.
+</li>
+<li>
+The <a
+href="http://lists.gnupg.org/pipermail/gnupg-users/2002-August/014721.html">using
+various subkeys</a> thread on the gnupg-users mailing list, where most of these
+issues were discussed.
+</li>
+<li>
+The <a
+href="http://lists.gnupg.org/pipermail/gnupg-devel/2002-September/007700.html">using
+subkey signatures</a> thread on gnupg-devel where I asked about the auto key
+retrieval problem.
+</li>
+<li>
+Other <a href="http://atom.smasher.org/gpg/">tutorials</a> on advanced black
+magic with keys by Atom Smasher, dealing with what you can do with subkeys.
+</li>
+</ul>
+<h2>Acknowledgments</h2>
+<p>
+Of course, thanks to the gnupg crew for the cool software, and especially to
+Werner Koch and David Shaw for replying to my initial questions about this. And
+to Jason Harris for fixing pks to accept keys with multiple subkeys, I hope
+this patch spreads really fast as soon as it is officially out.
+</p>
+<p>
+</p>
+</div>
+<hr>
+<div style="font-size: x-small;">
+©2002-2004 <a href="mailto:avbidder+gpg@fortytwo.ch">Adrian von Bidder</a>
+- Permission to redistribute and/or modify this document is granted if (i) the
+original author (Adrian von Bidder, Switzerland) is acknowledged and (ii) the
+document remains freely available for distribution and modification.
+</div>
+
+</body></html>
diff --git a/docs/_build/html/_static/plus.png b/docs/_build/html/_static/plus.png
new file mode 100644
index 0000000..b3cb374
--- /dev/null
+++ b/docs/_build/html/_static/plus.png
Binary files differ
diff --git a/docs/_build/html/_static/pygments.css b/docs/_build/html/_static/pygments.css
new file mode 100644
index 0000000..45bae6e
--- /dev/null
+++ b/docs/_build/html/_static/pygments.css
@@ -0,0 +1,69 @@
+.hll { background-color: #ffffcc }
+.c { color: #8f5902; font-style: italic } /* Comment */
+.err { color: #a40000; border: 1px solid #ef2929 } /* Error */
+.g { color: #000000 } /* Generic */
+.k { color: #204a87; font-weight: bold } /* Keyword */
+.l { color: #000000 } /* Literal */
+.n { color: #000000 } /* Name */
+.o { color: #ce5c00; font-weight: bold } /* Operator */
+.x { color: #000000 } /* Other */
+.p { color: #000000; font-weight: bold } /* Punctuation */
+.cm { color: #8f5902; font-style: italic } /* Comment.Multiline */
+.cp { color: #8f5902; font-style: italic } /* Comment.Preproc */
+.c1 { color: #8f5902; font-style: italic } /* Comment.Single */
+.cs { color: #8f5902; font-style: italic } /* Comment.Special */
+.gd { color: #a40000 } /* Generic.Deleted */
+.ge { color: #000000; font-style: italic } /* Generic.Emph */
+.gr { color: #ef2929 } /* Generic.Error */
+.gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.gi { color: #00A000 } /* Generic.Inserted */
+.go { color: #000000; font-style: italic } /* Generic.Output */
+.gp { color: #8f5902 } /* Generic.Prompt */
+.gs { color: #000000; font-weight: bold } /* Generic.Strong */
+.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.gt { color: #a40000; font-weight: bold } /* Generic.Traceback */
+.kc { color: #204a87; font-weight: bold } /* Keyword.Constant */
+.kd { color: #204a87; font-weight: bold } /* Keyword.Declaration */
+.kn { color: #204a87; font-weight: bold } /* Keyword.Namespace */
+.kp { color: #204a87; font-weight: bold } /* Keyword.Pseudo */
+.kr { color: #204a87; font-weight: bold } /* Keyword.Reserved */
+.kt { color: #204a87; font-weight: bold } /* Keyword.Type */
+.ld { color: #000000 } /* Literal.Date */
+.m { color: #0000cf; font-weight: bold } /* Literal.Number */
+.s { color: #4e9a06 } /* Literal.String */
+.na { color: #c4a000 } /* Name.Attribute */
+.nb { color: #204a87 } /* Name.Builtin */
+.nc { color: #000000 } /* Name.Class */
+.no { color: #000000 } /* Name.Constant */
+.nd { color: #5c35cc; font-weight: bold } /* Name.Decorator */
+.ni { color: #ce5c00 } /* Name.Entity */
+.ne { color: #cc0000; font-weight: bold } /* Name.Exception */
+.nf { color: #000000 } /* Name.Function */
+.nl { color: #f57900 } /* Name.Label */
+.nn { color: #000000 } /* Name.Namespace */
+.nx { color: #000000 } /* Name.Other */
+.py { color: #000000 } /* Name.Property */
+.nt { color: #204a87; font-weight: bold } /* Name.Tag */
+.nv { color: #000000 } /* Name.Variable */
+.ow { color: #204a87; font-weight: bold } /* Operator.Word */
+.w { color: #f8f8f8; text-decoration: underline } /* Text.Whitespace */
+.mf { color: #0000cf; font-weight: bold } /* Literal.Number.Float */
+.mh { color: #0000cf; font-weight: bold } /* Literal.Number.Hex */
+.mi { color: #0000cf; font-weight: bold } /* Literal.Number.Integer */
+.mo { color: #0000cf; font-weight: bold } /* Literal.Number.Oct */
+.sb { color: #4e9a06 } /* Literal.String.Backtick */
+.sc { color: #4e9a06 } /* Literal.String.Char */
+.sd { color: #8f5902; font-style: italic } /* Literal.String.Doc */
+.s2 { color: #4e9a06 } /* Literal.String.Double */
+.se { color: #4e9a06 } /* Literal.String.Escape */
+.sh { color: #4e9a06 } /* Literal.String.Heredoc */
+.si { color: #4e9a06 } /* Literal.String.Interpol */
+.sx { color: #4e9a06 } /* Literal.String.Other */
+.sr { color: #4e9a06 } /* Literal.String.Regex */
+.s1 { color: #4e9a06 } /* Literal.String.Single */
+.ss { color: #4e9a06 } /* Literal.String.Symbol */
+.bp { color: #3465a4 } /* Name.Builtin.Pseudo */
+.vc { color: #000000 } /* Name.Variable.Class */
+.vg { color: #000000 } /* Name.Variable.Global */
+.vi { color: #000000 } /* Name.Variable.Instance */
+.il { color: #0000cf; font-weight: bold } /* Literal.Number.Integer.Long */
diff --git a/docs/_build/html/_static/searchtools.js b/docs/_build/html/_static/searchtools.js
new file mode 100644
index 0000000..6e1f06b
--- /dev/null
+++ b/docs/_build/html/_static/searchtools.js
@@ -0,0 +1,622 @@
+/*
+ * searchtools.js_t
+ * ~~~~~~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilties for the full-text search.
+ *
+ * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+
+/**
+ * Porter Stemmer
+ */
+var Stemmer = function() {
+
+ var step2list = {
+ ational: 'ate',
+ tional: 'tion',
+ enci: 'ence',
+ anci: 'ance',
+ izer: 'ize',
+ bli: 'ble',
+ alli: 'al',
+ entli: 'ent',
+ eli: 'e',
+ ousli: 'ous',
+ ization: 'ize',
+ ation: 'ate',
+ ator: 'ate',
+ alism: 'al',
+ iveness: 'ive',
+ fulness: 'ful',
+ ousness: 'ous',
+ aliti: 'al',
+ iviti: 'ive',
+ biliti: 'ble',
+ logi: 'log'
+ };
+
+ var step3list = {
+ icate: 'ic',
+ ative: '',
+ alize: 'al',
+ iciti: 'ic',
+ ical: 'ic',
+ ful: '',
+ ness: ''
+ };
+
+ var c = "[^aeiou]"; // consonant
+ var v = "[aeiouy]"; // vowel
+ var C = c + "[^aeiouy]*"; // consonant sequence
+ var V = v + "[aeiou]*"; // vowel sequence
+
+ var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
+ var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
+ var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
+ var s_v = "^(" + C + ")?" + v; // vowel in stem
+
+ this.stemWord = function (w) {
+ var stem;
+ var suffix;
+ var firstch;
+ var origword = w;
+
+ if (w.length < 3)
+ return w;
+
+ var re;
+ var re2;
+ var re3;
+ var re4;
+
+ firstch = w.substr(0,1);
+ if (firstch == "y")
+ w = firstch.toUpperCase() + w.substr(1);
+
+ // Step 1a
+ re = /^(.+?)(ss|i)es$/;
+ re2 = /^(.+?)([^s])s$/;
+
+ if (re.test(w))
+ w = w.replace(re,"$1$2");
+ else if (re2.test(w))
+ w = w.replace(re2,"$1$2");
+
+ // Step 1b
+ re = /^(.+?)eed$/;
+ re2 = /^(.+?)(ed|ing)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ re = new RegExp(mgr0);
+ if (re.test(fp[1])) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+ }
+ else if (re2.test(w)) {
+ var fp = re2.exec(w);
+ stem = fp[1];
+ re2 = new RegExp(s_v);
+ if (re2.test(stem)) {
+ w = stem;
+ re2 = /(at|bl|iz)$/;
+ re3 = new RegExp("([^aeiouylsz])\\1$");
+ re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+ if (re2.test(w))
+ w = w + "e";
+ else if (re3.test(w)) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+ else if (re4.test(w))
+ w = w + "e";
+ }
+ }
+
+ // Step 1c
+ re = /^(.+?)y$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(s_v);
+ if (re.test(stem))
+ w = stem + "i";
+ }
+
+ // Step 2
+ re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ suffix = fp[2];
+ re = new RegExp(mgr0);
+ if (re.test(stem))
+ w = stem + step2list[suffix];
+ }
+
+ // Step 3
+ re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ suffix = fp[2];
+ re = new RegExp(mgr0);
+ if (re.test(stem))
+ w = stem + step3list[suffix];
+ }
+
+ // Step 4
+ re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
+ re2 = /^(.+?)(s|t)(ion)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(mgr1);
+ if (re.test(stem))
+ w = stem;
+ }
+ else if (re2.test(w)) {
+ var fp = re2.exec(w);
+ stem = fp[1] + fp[2];
+ re2 = new RegExp(mgr1);
+ if (re2.test(stem))
+ w = stem;
+ }
+
+ // Step 5
+ re = /^(.+?)e$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(mgr1);
+ re2 = new RegExp(meq1);
+ re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+ if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
+ w = stem;
+ }
+ re = /ll$/;
+ re2 = new RegExp(mgr1);
+ if (re.test(w) && re2.test(w)) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+
+ // and turn initial Y back to y
+ if (firstch == "y")
+ w = firstch.toLowerCase() + w.substr(1);
+ return w;
+ }
+}
+
+
+
+/**
+ * Simple result scoring code.
+ */
+var Scorer = {
+ // Implement the following function to further tweak the score for each result
+ // The function takes a result array [filename, title, anchor, descr, score]
+ // and returns the new score.
+ /*
+ score: function(result) {
+ return result[4];
+ },
+ */
+
+ // query matches the full name of an object
+ objNameMatch: 11,
+ // or matches in the last dotted part of the object name
+ objPartialMatch: 6,
+ // Additive scores depending on the priority of the object
+ objPrio: {0: 15, // used to be importantResults
+ 1: 5, // used to be objectResults
+ 2: -5}, // used to be unimportantResults
+ // Used when the priority is not in the mapping.
+ objPrioDefault: 0,
+
+ // query found in title
+ title: 15,
+ // query found in terms
+ term: 5
+};
+
+
+/**
+ * Search Module
+ */
+var Search = {
+
+ _index : null,
+ _queued_query : null,
+ _pulse_status : -1,
+
+ init : function() {
+ var params = $.getQueryParameters();
+ if (params.q) {
+ var query = params.q[0];
+ $('input[name="q"]')[0].value = query;
+ this.performSearch(query);
+ }
+ },
+
+ loadIndex : function(url) {
+ $.ajax({type: "GET", url: url, data: null,
+ dataType: "script", cache: true,
+ complete: function(jqxhr, textstatus) {
+ if (textstatus != "success") {
+ document.getElementById("searchindexloader").src = url;
+ }
+ }});
+ },
+
+ setIndex : function(index) {
+ var q;
+ this._index = index;
+ if ((q = this._queued_query) !== null) {
+ this._queued_query = null;
+ Search.query(q);
+ }
+ },
+
+ hasIndex : function() {
+ return this._index !== null;
+ },
+
+ deferQuery : function(query) {
+ this._queued_query = query;
+ },
+
+ stopPulse : function() {
+ this._pulse_status = 0;
+ },
+
+ startPulse : function() {
+ if (this._pulse_status >= 0)
+ return;
+ function pulse() {
+ var i;
+ Search._pulse_status = (Search._pulse_status + 1) % 4;
+ var dotString = '';
+ for (i = 0; i < Search._pulse_status; i++)
+ dotString += '.';
+ Search.dots.text(dotString);
+ if (Search._pulse_status > -1)
+ window.setTimeout(pulse, 500);
+ }
+ pulse();
+ },
+
+ /**
+ * perform a search for something (or wait until index is loaded)
+ */
+ performSearch : function(query) {
+ // create the required interface elements
+ this.out = $('#search-results');
+ this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
+ this.dots = $('<span></span>').appendTo(this.title);
+ this.status = $('<p style="display: none"></p>').appendTo(this.out);
+ this.output = $('<ul class="search"/>').appendTo(this.out);
+
+ $('#search-progress').text(_('Preparing search...'));
+ this.startPulse();
+
+ // index already loaded, the browser was quick!
+ if (this.hasIndex())
+ this.query(query);
+ else
+ this.deferQuery(query);
+ },
+
+ /**
+ * execute search (requires search index to be loaded)
+ */
+ query : function(query) {
+ var i;
+ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
+
+ // stem the searchterms and add them to the correct list
+ var stemmer = new Stemmer();
+ var searchterms = [];
+ var excluded = [];
+ var hlterms = [];
+ var tmp = query.split(/\s+/);
+ var objectterms = [];
+ for (i = 0; i < tmp.length; i++) {
+ if (tmp[i] !== "") {
+ objectterms.push(tmp[i].toLowerCase());
+ }
+
+ if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
+ tmp[i] === "") {
+ // skip this "word"
+ continue;
+ }
+ // stem the word
+ var word = stemmer.stemWord(tmp[i].toLowerCase());
+ var toAppend;
+ // select the correct list
+ if (word[0] == '-') {
+ toAppend = excluded;
+ word = word.substr(1);
+ }
+ else {
+ toAppend = searchterms;
+ hlterms.push(tmp[i].toLowerCase());
+ }
+ // only add if not already in the list
+ if (!$u.contains(toAppend, word))
+ toAppend.push(word);
+ }
+ var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
+
+ // console.debug('SEARCH: searching for:');
+ // console.info('required: ', searchterms);
+ // console.info('excluded: ', excluded);
+
+ // prepare search
+ var terms = this._index.terms;
+ var titleterms = this._index.titleterms;
+
+ // array of [filename, title, anchor, descr, score]
+ var results = [];
+ $('#search-progress').empty();
+
+ // lookup as object
+ for (i = 0; i < objectterms.length; i++) {
+ var others = [].concat(objectterms.slice(0, i),
+ objectterms.slice(i+1, objectterms.length));
+ results = results.concat(this.performObjectSearch(objectterms[i], others));
+ }
+
+ // lookup as search terms in fulltext
+ results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term))
+ .concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title));
+
+ // let the scorer override scores with a custom scoring function
+ if (Scorer.score) {
+ for (i = 0; i < results.length; i++)
+ results[i][4] = Scorer.score(results[i]);
+ }
+
+ // now sort the results by score (in opposite order of appearance, since the
+ // display function below uses pop() to retrieve items) and then
+ // alphabetically
+ results.sort(function(a, b) {
+ var left = a[4];
+ var right = b[4];
+ if (left > right) {
+ return 1;
+ } else if (left < right) {
+ return -1;
+ } else {
+ // same score: sort alphabetically
+ left = a[1].toLowerCase();
+ right = b[1].toLowerCase();
+ return (left > right) ? -1 : ((left < right) ? 1 : 0);
+ }
+ });
+
+ // for debugging
+ //Search.lastresults = results.slice(); // a copy
+ //console.info('search results:', Search.lastresults);
+
+ // print the results
+ var resultCount = results.length;
+ function displayNextItem() {
+ // results left, load the summary and display it
+ if (results.length) {
+ var item = results.pop();
+ var listItem = $('<li style="display:none"></li>');
+ if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
+ // dirhtml builder
+ var dirname = item[0] + '/';
+ if (dirname.match(/\/index\/$/)) {
+ dirname = dirname.substring(0, dirname.length-6);
+ } else if (dirname == 'index/') {
+ dirname = '';
+ }
+ listItem.append($('<a/>').attr('href',
+ DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
+ highlightstring + item[2]).html(item[1]));
+ } else {
+ // normal html builders
+ listItem.append($('<a/>').attr('href',
+ item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
+ highlightstring + item[2]).html(item[1]));
+ }
+ if (item[3]) {
+ listItem.append($('<span> (' + item[3] + ')</span>'));
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
+ $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt',
+ dataType: "text",
+ complete: function(jqxhr, textstatus) {
+ var data = jqxhr.responseText;
+ if (data !== '') {
+ listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
+ }
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ }});
+ } else {
+ // no source available, just display title
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ }
+ }
+ // search finished, update title and status message
+ else {
+ Search.stopPulse();
+ Search.title.text(_('Search Results'));
+ if (!resultCount)
+ Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
+ else
+ Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
+ Search.status.fadeIn(500);
+ }
+ }
+ displayNextItem();
+ },
+
+ /**
+ * search for object names
+ */
+ performObjectSearch : function(object, otherterms) {
+ var filenames = this._index.filenames;
+ var objects = this._index.objects;
+ var objnames = this._index.objnames;
+ var titles = this._index.titles;
+
+ var i;
+ var results = [];
+
+ for (var prefix in objects) {
+ for (var name in objects[prefix]) {
+ var fullname = (prefix ? prefix + '.' : '') + name;
+ if (fullname.toLowerCase().indexOf(object) > -1) {
+ var score = 0;
+ var parts = fullname.split('.');
+ // check for different match types: exact matches of full name or
+ // "last name" (i.e. last dotted part)
+ if (fullname == object || parts[parts.length - 1] == object) {
+ score += Scorer.objNameMatch;
+ // matches in last name
+ } else if (parts[parts.length - 1].indexOf(object) > -1) {
+ score += Scorer.objPartialMatch;
+ }
+ var match = objects[prefix][name];
+ var objname = objnames[match[1]][2];
+ var title = titles[match[0]];
+ // If more than one term searched for, we require other words to be
+ // found in the name/title/description
+ if (otherterms.length > 0) {
+ var haystack = (prefix + ' ' + name + ' ' +
+ objname + ' ' + title).toLowerCase();
+ var allfound = true;
+ for (i = 0; i < otherterms.length; i++) {
+ if (haystack.indexOf(otherterms[i]) == -1) {
+ allfound = false;
+ break;
+ }
+ }
+ if (!allfound) {
+ continue;
+ }
+ }
+ var descr = objname + _(', in ') + title;
+
+ var anchor = match[3];
+ if (anchor === '')
+ anchor = fullname;
+ else if (anchor == '-')
+ anchor = objnames[match[1]][1] + '-' + fullname;
+ // add custom score for some objects according to scorer
+ if (Scorer.objPrio.hasOwnProperty(match[2])) {
+ score += Scorer.objPrio[match[2]];
+ } else {
+ score += Scorer.objPrioDefault;
+ }
+ results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]);
+ }
+ }
+ }
+
+ return results;
+ },
+
+ /**
+ * search for full-text terms in the index
+ */
+ performTermsSearch : function(searchterms, excluded, terms, score) {
+ var filenames = this._index.filenames;
+ var titles = this._index.titles;
+
+ var i, j, file, files;
+ var fileMap = {};
+ var results = [];
+
+ // perform the search on the required terms
+ for (i = 0; i < searchterms.length; i++) {
+ var word = searchterms[i];
+ // no match but word was a required one
+ if ((files = terms[word]) === undefined)
+ break;
+ if (files.length === undefined) {
+ files = [files];
+ }
+ // create the mapping
+ for (j = 0; j < files.length; j++) {
+ file = files[j];
+ if (file in fileMap)
+ fileMap[file].push(word);
+ else
+ fileMap[file] = [word];
+ }
+ }
+
+ // now check if the files don't contain excluded terms
+ for (file in fileMap) {
+ var valid = true;
+
+ // check if all requirements are matched
+ if (fileMap[file].length != searchterms.length)
+ continue;
+
+ // ensure that none of the excluded terms is in the search result
+ for (i = 0; i < excluded.length; i++) {
+ if (terms[excluded[i]] == file ||
+ $u.contains(terms[excluded[i]] || [], file)) {
+ valid = false;
+ break;
+ }
+ }
+
+ // if we have still a valid result we can add it to the result list
+ if (valid) {
+ results.push([filenames[file], titles[file], '', null, score]);
+ }
+ }
+ return results;
+ },
+
+ /**
+ * helper function to return a node containing the
+ * search summary for a given text. keywords is a list
+ * of stemmed words, hlwords is the list of normal, unstemmed
+ * words. the first one is used to find the occurance, the
+ * latter for highlighting it.
+ */
+ makeSearchSummary : function(text, keywords, hlwords) {
+ var textLower = text.toLowerCase();
+ var start = 0;
+ $.each(keywords, function() {
+ var i = textLower.indexOf(this.toLowerCase());
+ if (i > -1)
+ start = i;
+ });
+ start = Math.max(start - 120, 0);
+ var excerpt = ((start > 0) ? '...' : '') +
+ $.trim(text.substr(start, 240)) +
+ ((start + 240 - text.length) ? '...' : '');
+ var rv = $('<div class="context"></div>').text(excerpt);
+ $.each(hlwords, function() {
+ rv = rv.highlightText(this, 'highlighted');
+ });
+ return rv;
+ }
+};
+
+$(document).ready(function() {
+ Search.init();
+}); \ No newline at end of file
diff --git a/docs/_build/html/_static/underscore.js b/docs/_build/html/_static/underscore.js
new file mode 100644
index 0000000..5b55f32
--- /dev/null
+++ b/docs/_build/html/_static/underscore.js
@@ -0,0 +1,31 @@
+// Underscore.js 1.3.1
+// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
+// Underscore is freely distributable under the MIT license.
+// Portions of Underscore are inspired or borrowed from Prototype,
+// Oliver Steele's Functional, and John Resig's Micro-Templating.
+// For all details and documentation:
+// http://documentcloud.github.com/underscore
+(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
+c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,
+h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each=
+b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==
+null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=
+function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=
+e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
+function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})});
+return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,
+c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest=
+b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]);
+return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,
+d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};
+var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,
+c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true:
+a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};
+b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,
+1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};
+b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};
+b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};b.mixin=function(a){j(b.functions(a),
+function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+
+u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=
+function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=
+true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
diff --git a/docs/_build/html/_static/up-pressed.png b/docs/_build/html/_static/up-pressed.png
new file mode 100644
index 0000000..8bd587a
--- /dev/null
+++ b/docs/_build/html/_static/up-pressed.png
Binary files differ
diff --git a/docs/_build/html/_static/up.png b/docs/_build/html/_static/up.png
new file mode 100644
index 0000000..b946256
--- /dev/null
+++ b/docs/_build/html/_static/up.png
Binary files differ
diff --git a/docs/_build/html/_static/websupport.js b/docs/_build/html/_static/websupport.js
new file mode 100644
index 0000000..71c0a13
--- /dev/null
+++ b/docs/_build/html/_static/websupport.js
@@ -0,0 +1,808 @@
+/*
+ * websupport.js
+ * ~~~~~~~~~~~~~
+ *
+ * sphinx.websupport utilties for all documentation.
+ *
+ * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+(function($) {
+ $.fn.autogrow = function() {
+ return this.each(function() {
+ var textarea = this;
+
+ $.fn.autogrow.resize(textarea);
+
+ $(textarea)
+ .focus(function() {
+ textarea.interval = setInterval(function() {
+ $.fn.autogrow.resize(textarea);
+ }, 500);
+ })
+ .blur(function() {
+ clearInterval(textarea.interval);
+ });
+ });
+ };
+
+ $.fn.autogrow.resize = function(textarea) {
+ var lineHeight = parseInt($(textarea).css('line-height'), 10);
+ var lines = textarea.value.split('\n');
+ var columns = textarea.cols;
+ var lineCount = 0;
+ $.each(lines, function() {
+ lineCount += Math.ceil(this.length / columns) || 1;
+ });
+ var height = lineHeight * (lineCount + 1);
+ $(textarea).css('height', height);
+ };
+})(jQuery);
+
+(function($) {
+ var comp, by;
+
+ function init() {
+ initEvents();
+ initComparator();
+ }
+
+ function initEvents() {
+ $('a.comment-close').live("click", function(event) {
+ event.preventDefault();
+ hide($(this).attr('id').substring(2));
+ });
+ $('a.vote').live("click", function(event) {
+ event.preventDefault();
+ handleVote($(this));
+ });
+ $('a.reply').live("click", function(event) {
+ event.preventDefault();
+ openReply($(this).attr('id').substring(2));
+ });
+ $('a.close-reply').live("click", function(event) {
+ event.preventDefault();
+ closeReply($(this).attr('id').substring(2));
+ });
+ $('a.sort-option').live("click", function(event) {
+ event.preventDefault();
+ handleReSort($(this));
+ });
+ $('a.show-proposal').live("click", function(event) {
+ event.preventDefault();
+ showProposal($(this).attr('id').substring(2));
+ });
+ $('a.hide-proposal').live("click", function(event) {
+ event.preventDefault();
+ hideProposal($(this).attr('id').substring(2));
+ });
+ $('a.show-propose-change').live("click", function(event) {
+ event.preventDefault();
+ showProposeChange($(this).attr('id').substring(2));
+ });
+ $('a.hide-propose-change').live("click", function(event) {
+ event.preventDefault();
+ hideProposeChange($(this).attr('id').substring(2));
+ });
+ $('a.accept-comment').live("click", function(event) {
+ event.preventDefault();
+ acceptComment($(this).attr('id').substring(2));
+ });
+ $('a.delete-comment').live("click", function(event) {
+ event.preventDefault();
+ deleteComment($(this).attr('id').substring(2));
+ });
+ $('a.comment-markup').live("click", function(event) {
+ event.preventDefault();
+ toggleCommentMarkupBox($(this).attr('id').substring(2));
+ });
+ }
+
+ /**
+ * Set comp, which is a comparator function used for sorting and
+ * inserting comments into the list.
+ */
+ function setComparator() {
+ // If the first three letters are "asc", sort in ascending order
+ // and remove the prefix.
+ if (by.substring(0,3) == 'asc') {
+ var i = by.substring(3);
+ comp = function(a, b) { return a[i] - b[i]; };
+ } else {
+ // Otherwise sort in descending order.
+ comp = function(a, b) { return b[by] - a[by]; };
+ }
+
+ // Reset link styles and format the selected sort option.
+ $('a.sel').attr('href', '#').removeClass('sel');
+ $('a.by' + by).removeAttr('href').addClass('sel');
+ }
+
+ /**
+ * Create a comp function. If the user has preferences stored in
+ * the sortBy cookie, use those, otherwise use the default.
+ */
+ function initComparator() {
+ by = 'rating'; // Default to sort by rating.
+ // If the sortBy cookie is set, use that instead.
+ if (document.cookie.length > 0) {
+ var start = document.cookie.indexOf('sortBy=');
+ if (start != -1) {
+ start = start + 7;
+ var end = document.cookie.indexOf(";", start);
+ if (end == -1) {
+ end = document.cookie.length;
+ by = unescape(document.cookie.substring(start, end));
+ }
+ }
+ }
+ setComparator();
+ }
+
+ /**
+ * Show a comment div.
+ */
+ function show(id) {
+ $('#ao' + id).hide();
+ $('#ah' + id).show();
+ var context = $.extend({id: id}, opts);
+ var popup = $(renderTemplate(popupTemplate, context)).hide();
+ popup.find('textarea[name="proposal"]').hide();
+ popup.find('a.by' + by).addClass('sel');
+ var form = popup.find('#cf' + id);
+ form.submit(function(event) {
+ event.preventDefault();
+ addComment(form);
+ });
+ $('#s' + id).after(popup);
+ popup.slideDown('fast', function() {
+ getComments(id);
+ });
+ }
+
+ /**
+ * Hide a comment div.
+ */
+ function hide(id) {
+ $('#ah' + id).hide();
+ $('#ao' + id).show();
+ var div = $('#sc' + id);
+ div.slideUp('fast', function() {
+ div.remove();
+ });
+ }
+
+ /**
+ * Perform an ajax request to get comments for a node
+ * and insert the comments into the comments tree.
+ */
+ function getComments(id) {
+ $.ajax({
+ type: 'GET',
+ url: opts.getCommentsURL,
+ data: {node: id},
+ success: function(data, textStatus, request) {
+ var ul = $('#cl' + id);
+ var speed = 100;
+ $('#cf' + id)
+ .find('textarea[name="proposal"]')
+ .data('source', data.source);
+
+ if (data.comments.length === 0) {
+ ul.html('<li>No comments yet.</li>');
+ ul.data('empty', true);
+ } else {
+ // If there are comments, sort them and put them in the list.
+ var comments = sortComments(data.comments);
+ speed = data.comments.length * 100;
+ appendComments(comments, ul);
+ ul.data('empty', false);
+ }
+ $('#cn' + id).slideUp(speed + 200);
+ ul.slideDown(speed);
+ },
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem retrieving the comments.');
+ },
+ dataType: 'json'
+ });
+ }
+
+ /**
+ * Add a comment via ajax and insert the comment into the comment tree.
+ */
+ function addComment(form) {
+ var node_id = form.find('input[name="node"]').val();
+ var parent_id = form.find('input[name="parent"]').val();
+ var text = form.find('textarea[name="comment"]').val();
+ var proposal = form.find('textarea[name="proposal"]').val();
+
+ if (text == '') {
+ showError('Please enter a comment.');
+ return;
+ }
+
+ // Disable the form that is being submitted.
+ form.find('textarea,input').attr('disabled', 'disabled');
+
+ // Send the comment to the server.
+ $.ajax({
+ type: "POST",
+ url: opts.addCommentURL,
+ dataType: 'json',
+ data: {
+ node: node_id,
+ parent: parent_id,
+ text: text,
+ proposal: proposal
+ },
+ success: function(data, textStatus, error) {
+ // Reset the form.
+ if (node_id) {
+ hideProposeChange(node_id);
+ }
+ form.find('textarea')
+ .val('')
+ .add(form.find('input'))
+ .removeAttr('disabled');
+ var ul = $('#cl' + (node_id || parent_id));
+ if (ul.data('empty')) {
+ $(ul).empty();
+ ul.data('empty', false);
+ }
+ insertComment(data.comment);
+ var ao = $('#ao' + node_id);
+ ao.find('img').attr({'src': opts.commentBrightImage});
+ if (node_id) {
+ // if this was a "root" comment, remove the commenting box
+ // (the user can get it back by reopening the comment popup)
+ $('#ca' + node_id).slideUp();
+ }
+ },
+ error: function(request, textStatus, error) {
+ form.find('textarea,input').removeAttr('disabled');
+ showError('Oops, there was a problem adding the comment.');
+ }
+ });
+ }
+
+ /**
+ * Recursively append comments to the main comment list and children
+ * lists, creating the comment tree.
+ */
+ function appendComments(comments, ul) {
+ $.each(comments, function() {
+ var div = createCommentDiv(this);
+ ul.append($(document.createElement('li')).html(div));
+ appendComments(this.children, div.find('ul.comment-children'));
+ // To avoid stagnating data, don't store the comments children in data.
+ this.children = null;
+ div.data('comment', this);
+ });
+ }
+
+ /**
+ * After adding a new comment, it must be inserted in the correct
+ * location in the comment tree.
+ */
+ function insertComment(comment) {
+ var div = createCommentDiv(comment);
+
+ // To avoid stagnating data, don't store the comments children in data.
+ comment.children = null;
+ div.data('comment', comment);
+
+ var ul = $('#cl' + (comment.node || comment.parent));
+ var siblings = getChildren(ul);
+
+ var li = $(document.createElement('li'));
+ li.hide();
+
+ // Determine where in the parents children list to insert this comment.
+ for(i=0; i < siblings.length; i++) {
+ if (comp(comment, siblings[i]) <= 0) {
+ $('#cd' + siblings[i].id)
+ .parent()
+ .before(li.html(div));
+ li.slideDown('fast');
+ return;
+ }
+ }
+
+ // If we get here, this comment rates lower than all the others,
+ // or it is the only comment in the list.
+ ul.append(li.html(div));
+ li.slideDown('fast');
+ }
+
+ function acceptComment(id) {
+ $.ajax({
+ type: 'POST',
+ url: opts.acceptCommentURL,
+ data: {id: id},
+ success: function(data, textStatus, request) {
+ $('#cm' + id).fadeOut('fast');
+ $('#cd' + id).removeClass('moderate');
+ },
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem accepting the comment.');
+ }
+ });
+ }
+
+ function deleteComment(id) {
+ $.ajax({
+ type: 'POST',
+ url: opts.deleteCommentURL,
+ data: {id: id},
+ success: function(data, textStatus, request) {
+ var div = $('#cd' + id);
+ if (data == 'delete') {
+ // Moderator mode: remove the comment and all children immediately
+ div.slideUp('fast', function() {
+ div.remove();
+ });
+ return;
+ }
+ // User mode: only mark the comment as deleted
+ div
+ .find('span.user-id:first')
+ .text('[deleted]').end()
+ .find('div.comment-text:first')
+ .text('[deleted]').end()
+ .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
+ ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
+ .remove();
+ var comment = div.data('comment');
+ comment.username = '[deleted]';
+ comment.text = '[deleted]';
+ div.data('comment', comment);
+ },
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem deleting the comment.');
+ }
+ });
+ }
+
+ function showProposal(id) {
+ $('#sp' + id).hide();
+ $('#hp' + id).show();
+ $('#pr' + id).slideDown('fast');
+ }
+
+ function hideProposal(id) {
+ $('#hp' + id).hide();
+ $('#sp' + id).show();
+ $('#pr' + id).slideUp('fast');
+ }
+
+ function showProposeChange(id) {
+ $('#pc' + id).hide();
+ $('#hc' + id).show();
+ var textarea = $('#pt' + id);
+ textarea.val(textarea.data('source'));
+ $.fn.autogrow.resize(textarea[0]);
+ textarea.slideDown('fast');
+ }
+
+ function hideProposeChange(id) {
+ $('#hc' + id).hide();
+ $('#pc' + id).show();
+ var textarea = $('#pt' + id);
+ textarea.val('').removeAttr('disabled');
+ textarea.slideUp('fast');
+ }
+
+ function toggleCommentMarkupBox(id) {
+ $('#mb' + id).toggle();
+ }
+
+ /** Handle when the user clicks on a sort by link. */
+ function handleReSort(link) {
+ var classes = link.attr('class').split(/\s+/);
+ for (var i=0; i<classes.length; i++) {
+ if (classes[i] != 'sort-option') {
+ by = classes[i].substring(2);
+ }
+ }
+ setComparator();
+ // Save/update the sortBy cookie.
+ var expiration = new Date();
+ expiration.setDate(expiration.getDate() + 365);
+ document.cookie= 'sortBy=' + escape(by) +
+ ';expires=' + expiration.toUTCString();
+ $('ul.comment-ul').each(function(index, ul) {
+ var comments = getChildren($(ul), true);
+ comments = sortComments(comments);
+ appendComments(comments, $(ul).empty());
+ });
+ }
+
+ /**
+ * Function to process a vote when a user clicks an arrow.
+ */
+ function handleVote(link) {
+ if (!opts.voting) {
+ showError("You'll need to login to vote.");
+ return;
+ }
+
+ var id = link.attr('id');
+ if (!id) {
+ // Didn't click on one of the voting arrows.
+ return;
+ }
+ // If it is an unvote, the new vote value is 0,
+ // Otherwise it's 1 for an upvote, or -1 for a downvote.
+ var value = 0;
+ if (id.charAt(1) != 'u') {
+ value = id.charAt(0) == 'u' ? 1 : -1;
+ }
+ // The data to be sent to the server.
+ var d = {
+ comment_id: id.substring(2),
+ value: value
+ };
+
+ // Swap the vote and unvote links.
+ link.hide();
+ $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
+ .show();
+
+ // The div the comment is displayed in.
+ var div = $('div#cd' + d.comment_id);
+ var data = div.data('comment');
+
+ // If this is not an unvote, and the other vote arrow has
+ // already been pressed, unpress it.
+ if ((d.value !== 0) && (data.vote === d.value * -1)) {
+ $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
+ $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
+ }
+
+ // Update the comments rating in the local data.
+ data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
+ data.vote = d.value;
+ div.data('comment', data);
+
+ // Change the rating text.
+ div.find('.rating:first')
+ .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
+
+ // Send the vote information to the server.
+ $.ajax({
+ type: "POST",
+ url: opts.processVoteURL,
+ data: d,
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem casting that vote.');
+ }
+ });
+ }
+
+ /**
+ * Open a reply form used to reply to an existing comment.
+ */
+ function openReply(id) {
+ // Swap out the reply link for the hide link
+ $('#rl' + id).hide();
+ $('#cr' + id).show();
+
+ // Add the reply li to the children ul.
+ var div = $(renderTemplate(replyTemplate, {id: id})).hide();
+ $('#cl' + id)
+ .prepend(div)
+ // Setup the submit handler for the reply form.
+ .find('#rf' + id)
+ .submit(function(event) {
+ event.preventDefault();
+ addComment($('#rf' + id));
+ closeReply(id);
+ })
+ .find('input[type=button]')
+ .click(function() {
+ closeReply(id);
+ });
+ div.slideDown('fast', function() {
+ $('#rf' + id).find('textarea').focus();
+ });
+ }
+
+ /**
+ * Close the reply form opened with openReply.
+ */
+ function closeReply(id) {
+ // Remove the reply div from the DOM.
+ $('#rd' + id).slideUp('fast', function() {
+ $(this).remove();
+ });
+
+ // Swap out the hide link for the reply link
+ $('#cr' + id).hide();
+ $('#rl' + id).show();
+ }
+
+ /**
+ * Recursively sort a tree of comments using the comp comparator.
+ */
+ function sortComments(comments) {
+ comments.sort(comp);
+ $.each(comments, function() {
+ this.children = sortComments(this.children);
+ });
+ return comments;
+ }
+
+ /**
+ * Get the children comments from a ul. If recursive is true,
+ * recursively include childrens' children.
+ */
+ function getChildren(ul, recursive) {
+ var children = [];
+ ul.children().children("[id^='cd']")
+ .each(function() {
+ var comment = $(this).data('comment');
+ if (recursive)
+ comment.children = getChildren($(this).find('#cl' + comment.id), true);
+ children.push(comment);
+ });
+ return children;
+ }
+
+ /** Create a div to display a comment in. */
+ function createCommentDiv(comment) {
+ if (!comment.displayed && !opts.moderator) {
+ return $('<div class="moderate">Thank you! Your comment will show up '
+ + 'once it is has been approved by a moderator.</div>');
+ }
+ // Prettify the comment rating.
+ comment.pretty_rating = comment.rating + ' point' +
+ (comment.rating == 1 ? '' : 's');
+ // Make a class (for displaying not yet moderated comments differently)
+ comment.css_class = comment.displayed ? '' : ' moderate';
+ // Create a div for this comment.
+ var context = $.extend({}, opts, comment);
+ var div = $(renderTemplate(commentTemplate, context));
+
+ // If the user has voted on this comment, highlight the correct arrow.
+ if (comment.vote) {
+ var direction = (comment.vote == 1) ? 'u' : 'd';
+ div.find('#' + direction + 'v' + comment.id).hide();
+ div.find('#' + direction + 'u' + comment.id).show();
+ }
+
+ if (opts.moderator || comment.text != '[deleted]') {
+ div.find('a.reply').show();
+ if (comment.proposal_diff)
+ div.find('#sp' + comment.id).show();
+ if (opts.moderator && !comment.displayed)
+ div.find('#cm' + comment.id).show();
+ if (opts.moderator || (opts.username == comment.username))
+ div.find('#dc' + comment.id).show();
+ }
+ return div;
+ }
+
+ /**
+ * A simple template renderer. Placeholders such as <%id%> are replaced
+ * by context['id'] with items being escaped. Placeholders such as <#id#>
+ * are not escaped.
+ */
+ function renderTemplate(template, context) {
+ var esc = $(document.createElement('div'));
+
+ function handle(ph, escape) {
+ var cur = context;
+ $.each(ph.split('.'), function() {
+ cur = cur[this];
+ });
+ return escape ? esc.text(cur || "").html() : cur;
+ }
+
+ return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
+ return handle(arguments[2], arguments[1] == '%' ? true : false);
+ });
+ }
+
+ /** Flash an error message briefly. */
+ function showError(message) {
+ $(document.createElement('div')).attr({'class': 'popup-error'})
+ .append($(document.createElement('div'))
+ .attr({'class': 'error-message'}).text(message))
+ .appendTo('body')
+ .fadeIn("slow")
+ .delay(2000)
+ .fadeOut("slow");
+ }
+
+ /** Add a link the user uses to open the comments popup. */
+ $.fn.comment = function() {
+ return this.each(function() {
+ var id = $(this).attr('id').substring(1);
+ var count = COMMENT_METADATA[id];
+ var title = count + ' comment' + (count == 1 ? '' : 's');
+ var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
+ var addcls = count == 0 ? ' nocomment' : '';
+ $(this)
+ .append(
+ $(document.createElement('a')).attr({
+ href: '#',
+ 'class': 'sphinx-comment-open' + addcls,
+ id: 'ao' + id
+ })
+ .append($(document.createElement('img')).attr({
+ src: image,
+ alt: 'comment',
+ title: title
+ }))
+ .click(function(event) {
+ event.preventDefault();
+ show($(this).attr('id').substring(2));
+ })
+ )
+ .append(
+ $(document.createElement('a')).attr({
+ href: '#',
+ 'class': 'sphinx-comment-close hidden',
+ id: 'ah' + id
+ })
+ .append($(document.createElement('img')).attr({
+ src: opts.closeCommentImage,
+ alt: 'close',
+ title: 'close'
+ }))
+ .click(function(event) {
+ event.preventDefault();
+ hide($(this).attr('id').substring(2));
+ })
+ );
+ });
+ };
+
+ var opts = {
+ processVoteURL: '/_process_vote',
+ addCommentURL: '/_add_comment',
+ getCommentsURL: '/_get_comments',
+ acceptCommentURL: '/_accept_comment',
+ deleteCommentURL: '/_delete_comment',
+ commentImage: '/static/_static/comment.png',
+ closeCommentImage: '/static/_static/comment-close.png',
+ loadingImage: '/static/_static/ajax-loader.gif',
+ commentBrightImage: '/static/_static/comment-bright.png',
+ upArrow: '/static/_static/up.png',
+ downArrow: '/static/_static/down.png',
+ upArrowPressed: '/static/_static/up-pressed.png',
+ downArrowPressed: '/static/_static/down-pressed.png',
+ voting: false,
+ moderator: false
+ };
+
+ if (typeof COMMENT_OPTIONS != "undefined") {
+ opts = jQuery.extend(opts, COMMENT_OPTIONS);
+ }
+
+ var popupTemplate = '\
+ <div class="sphinx-comments" id="sc<%id%>">\
+ <p class="sort-options">\
+ Sort by:\
+ <a href="#" class="sort-option byrating">best rated</a>\
+ <a href="#" class="sort-option byascage">newest</a>\
+ <a href="#" class="sort-option byage">oldest</a>\
+ </p>\
+ <div class="comment-header">Comments</div>\
+ <div class="comment-loading" id="cn<%id%>">\
+ loading comments... <img src="<%loadingImage%>" alt="" /></div>\
+ <ul id="cl<%id%>" class="comment-ul"></ul>\
+ <div id="ca<%id%>">\
+ <p class="add-a-comment">Add a comment\
+ (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
+ <div class="comment-markup-box" id="mb<%id%>">\
+ reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
+ <tt>``code``</tt>, \
+ code blocks: <tt>::</tt> and an indented block after blank line</div>\
+ <form method="post" id="cf<%id%>" class="comment-form" action="">\
+ <textarea name="comment" cols="80"></textarea>\
+ <p class="propose-button">\
+ <a href="#" id="pc<%id%>" class="show-propose-change">\
+ Propose a change &#9657;\
+ </a>\
+ <a href="#" id="hc<%id%>" class="hide-propose-change">\
+ Propose a change &#9663;\
+ </a>\
+ </p>\
+ <textarea name="proposal" id="pt<%id%>" cols="80"\
+ spellcheck="false"></textarea>\
+ <input type="submit" value="Add comment" />\
+ <input type="hidden" name="node" value="<%id%>" />\
+ <input type="hidden" name="parent" value="" />\
+ </form>\
+ </div>\
+ </div>';
+
+ var commentTemplate = '\
+ <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
+ <div class="vote">\
+ <div class="arrow">\
+ <a href="#" id="uv<%id%>" class="vote" title="vote up">\
+ <img src="<%upArrow%>" />\
+ </a>\
+ <a href="#" id="uu<%id%>" class="un vote" title="vote up">\
+ <img src="<%upArrowPressed%>" />\
+ </a>\
+ </div>\
+ <div class="arrow">\
+ <a href="#" id="dv<%id%>" class="vote" title="vote down">\
+ <img src="<%downArrow%>" id="da<%id%>" />\
+ </a>\
+ <a href="#" id="du<%id%>" class="un vote" title="vote down">\
+ <img src="<%downArrowPressed%>" />\
+ </a>\
+ </div>\
+ </div>\
+ <div class="comment-content">\
+ <p class="tagline comment">\
+ <span class="user-id"><%username%></span>\
+ <span class="rating"><%pretty_rating%></span>\
+ <span class="delta"><%time.delta%></span>\
+ </p>\
+ <div class="comment-text comment"><#text#></div>\
+ <p class="comment-opts comment">\
+ <a href="#" class="reply hidden" id="rl<%id%>">reply &#9657;</a>\
+ <a href="#" class="close-reply" id="cr<%id%>">reply &#9663;</a>\
+ <a href="#" id="sp<%id%>" class="show-proposal">proposal &#9657;</a>\
+ <a href="#" id="hp<%id%>" class="hide-proposal">proposal &#9663;</a>\
+ <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
+ <span id="cm<%id%>" class="moderation hidden">\
+ <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
+ </span>\
+ </p>\
+ <pre class="proposal" id="pr<%id%>">\
+<#proposal_diff#>\
+ </pre>\
+ <ul class="comment-children" id="cl<%id%>"></ul>\
+ </div>\
+ <div class="clearleft"></div>\
+ </div>\
+ </div>';
+
+ var replyTemplate = '\
+ <li>\
+ <div class="reply-div" id="rd<%id%>">\
+ <form id="rf<%id%>">\
+ <textarea name="comment" cols="80"></textarea>\
+ <input type="submit" value="Add reply" />\
+ <input type="button" value="Cancel" />\
+ <input type="hidden" name="parent" value="<%id%>" />\
+ <input type="hidden" name="node" value="" />\
+ </form>\
+ </div>\
+ </li>';
+
+ $(document).ready(function() {
+ init();
+ });
+})(jQuery);
+
+$(document).ready(function() {
+ // add comment anchors for all paragraphs that are commentable
+ $('.sphinx-has-comment').comment();
+
+ // highlight search words in search results
+ $("div.context").each(function() {
+ var params = $.getQueryParameters();
+ var terms = (params.q) ? params.q[0].split(/\s+/) : [];
+ var result = $(this);
+ $.each(terms, function() {
+ result.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ });
+
+ // directly open comment window if requested
+ var anchor = document.location.hash;
+ if (anchor.substring(0, 9) == '#comment-') {
+ $('#ao' + anchor.substring(9)).click();
+ document.location.hash = '#s' + anchor.substring(9);
+ }
+});
diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html
new file mode 100644
index 0000000..e320627
--- /dev/null
+++ b/docs/_build/html/genindex.html
@@ -0,0 +1,932 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>Index &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: './',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="index.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="#" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+
+<h1 id="index">Index</h1>
+
+<div class="genindex-jumpbox">
+ <a href="#_"><strong>_</strong></a>
+ | <a href="#A"><strong>A</strong></a>
+ | <a href="#C"><strong>C</strong></a>
+ | <a href="#D"><strong>D</strong></a>
+ | <a href="#E"><strong>E</strong></a>
+ | <a href="#F"><strong>F</strong></a>
+ | <a href="#G"><strong>G</strong></a>
+ | <a href="#H"><strong>H</strong></a>
+ | <a href="#I"><strong>I</strong></a>
+ | <a href="#K"><strong>K</strong></a>
+ | <a href="#L"><strong>L</strong></a>
+ | <a href="#N"><strong>N</strong></a>
+ | <a href="#O"><strong>O</strong></a>
+ | <a href="#P"><strong>P</strong></a>
+ | <a href="#R"><strong>R</strong></a>
+ | <a href="#S"><strong>S</strong></a>
+ | <a href="#T"><strong>T</strong></a>
+ | <a href="#U"><strong>U</strong></a>
+ | <a href="#V"><strong>V</strong></a>
+ | <a href="#W"><strong>W</strong></a>
+ | <a href="#X"><strong>X</strong></a>
+
+</div>
+<h2 id="_">_</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase.__init__">__init__() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGMeta.__new__">__new__() (GPGMeta static method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase.__remove_path__">__remove_path__() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG._batch_limit">_batch_limit (GPG attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._check_keyserver">_check_keyserver() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._check_preferences">_check_preferences() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._collect_output">_collect_output() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._copy_data">_copy_data() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult._counts">_counts (ImportResult attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._create_if_necessary">_create_if_necessary() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG._create_trustdb">_create_trustdb() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._deprefix">_deprefix() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._encrypt">_encrypt() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG._export_ownertrust">_export_ownertrust() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult._fields">_fields (ImportResult attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGMeta._find_agent">_find_agent() (gnupg._meta.GPGMeta class method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._find_binary">_find_binary() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG._fix_trustdb">_fix_trustdb() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._fix_unsafe">_fix_unsafe() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._generated_keys">_generated_keys (GPGBase attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._generated_keys_getter">_generated_keys_getter() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._generated_keys_setter">_generated_keys_setter() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._get_all_gnupg_options">_get_all_gnupg_options() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._get_options_group">_get_options_group() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._handle_io">_handle_io() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Crypt._handle_status">_handle_status() (Crypt method)</a>
+ </dt>
+
+ <dd><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.DeleteResult._handle_status">(DeleteResult method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.GenKey._handle_status">(GenKey method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult._handle_status">(ImportResult method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys._handle_status">(ListKeys method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListPackets._handle_status">(ListPackets method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign._handle_status">(Sign method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify._handle_status">(Verify method)</a>
+ </dt>
+
+ </dl></dd>
+
+ <dt><a href="gnupg.html#gnupg._util._has_readwrite">_has_readwrite() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._homedir_getter">_homedir_getter() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._homedir_setter">_homedir_setter() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._hyphenate">_hyphenate() (in module gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG._import_ownertrust">_import_ownertrust() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._is_allowed">_is_allowed() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._is_file">_is_file() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._is_gpg1">_is_gpg1() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._is_gpg2">_is_gpg2() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._is_hex">_is_hex() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._is_list_or_tuple">_is_list_or_tuple() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._is_stream">_is_stream() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._is_string">_is_string() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._make_args">_make_args() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._make_binary_stream">_make_binary_stream() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._make_passphrase">_make_passphrase() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._make_random_string">_make_random_string() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._match_version_string">_match_version_string() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._next_year">_next_year() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._now">_now() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult._ok_reason">_ok_reason (ImportResult attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._open_subprocess">_open_subprocess() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult._problem_reason">_problem_reason (ImportResult attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._read_data">_read_data() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._read_response">_read_response() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._recv_keys">_recv_keys() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._sanitise">_sanitise() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers._sanitise_list">_sanitise_list() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._separate_keyword">_separate_keyword() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase._sign_file">_sign_file() (GPGBase method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._threaded_copy_data">_threaded_copy_data() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._utc_epoch">_utc_epoch() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._which">_which() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util._write_passphrase">_write_passphrase() (in module gnupg._util)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="A">A</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._util.author_info">author_info() (in module gnupg._util)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="C">C</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._util.create_uid_email">create_uid_email() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.creation_date">creation_date (Verify attribute)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Crypt">Crypt (class in gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="D">D</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Crypt.data">data (Crypt attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.decrypt">decrypt() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.decrypt_file">decrypt_file() (GPG method)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase.default_preference_list">default_preference_list (GPGBase attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.delete_keys">delete_keys() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.DeleteResult">DeleteResult (class in gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="E">E</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.encrypt">encrypt() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.expire_timestamp">expire_timestamp (Verify attribute)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.export_keys">export_keys() (GPG method)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="F">F</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._util.find_encodings">find_encodings() (in module gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign.fingerprint">fingerprint (Sign attribute)</a>
+ </dt>
+
+ <dd><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.fingerprint">(Verify attribute)</a>
+ </dt>
+
+ </dl></dd>
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult.fingerprints">fingerprints (ImportResult attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys.fpr">fpr() (ListKeys method)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="G">G</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.gen_key">gen_key() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.gen_key_input">gen_key_input() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.GenKey">GenKey (class in gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#module-gnupg">gnupg (module)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#module-gnupg._meta">gnupg._meta (module)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#module-gnupg._parsers">gnupg._parsers (module)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#module-gnupg._util">gnupg._util (module)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG">GPG (class in gnupg)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase">GPGBase (class in gnupg._meta)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGMeta">GPGMeta (class in gnupg._meta)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="H">H</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase.homedir">homedir (GPGBase attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="I">I</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.import_keys">import_keys() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult">ImportResult (class in gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._util.InheritableProperty">InheritableProperty (class in gnupg._util)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.is_gpg1">is_gpg1() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.is_gpg2">is_gpg2() (GPG method)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="K">K</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys.key">key() (ListKeys method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.key_id">key_id (Verify attribute)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.GenKey.keyring">keyring (GenKey attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._meta.GPGBase.keyserver">keyserver (GPGBase attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="L">L</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.list_keys">list_keys() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.list_packets">list_packets() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.list_sigs">list_sigs() (GPG method)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys">ListKeys (class in gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListPackets">ListPackets (class in gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="N">N</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListPackets.need_passphrase">need_passphrase (ListPackets attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListPackets.need_passphrase_sym">need_passphrase_sym (ListPackets attribute)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.nodata">nodata() (in module gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="O">O</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Crypt.ok">ok (Crypt attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="P">P</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.DeleteResult.problem_reason">problem_reason (DeleteResult attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.progress">progress() (in module gnupg._parsers)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ProtectedOption">ProtectedOption</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys.pub">pub() (ListKeys method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.pubkey_fingerprint">pubkey_fingerprint (Verify attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="R">R</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.recv_keys">recv_keys() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult.results">results (ImportResult attribute)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt>
+ RFC
+ </dt>
+
+ <dd><dl>
+
+ <dt><a href="gnupg.html#index-0">RFC 1991</a>
+ </dt>
+
+ </dl></dd>
+ </dl></td>
+</tr></table>
+
+<h2 id="S">S</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys.sec">sec() (ListKeys method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.GenKey.secring">secring (GenKey attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign.sig_algo">sig_algo (Sign attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign.sig_hash_also">sig_hash_also (Sign attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.sig_timestamp">sig_timestamp (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign.sig_type">sig_type (Sign attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign">Sign (class in gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.sign">sign() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.signature_id">signature_id (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Crypt.status">status (Crypt attribute)</a>
+ </dt>
+
+ <dd><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListPackets.status">(ListPackets attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.status">(Verify attribute)</a>
+ </dt>
+
+ </dl></dd>
+
+ <dt><a href="gnupg.html#gnupg._util.Storage">Storage (class in gnupg._util)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys.sub">sub() (ListKeys method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult.summary">summary() (ImportResult method)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="T">T</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign.timestamp">timestamp (Sign attribute)</a>
+ </dt>
+
+ <dd><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.timestamp">(Verify attribute)</a>
+ </dt>
+
+ </dl></dd>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.TRUST_FULLY">TRUST_FULLY (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.trust_level">trust_level (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.TRUST_LEVELS">TRUST_LEVELS (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.TRUST_MARGINAL">TRUST_MARGINAL (Verify attribute)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.TRUST_NEVER">TRUST_NEVER (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.trust_text">trust_text (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.TRUST_ULTIMATE">TRUST_ULTIMATE (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.TRUST_UNDEFINED">TRUST_UNDEFINED (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.GenKey.type">type (GenKey attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="U">U</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListKeys.uid">uid() (ListKeys method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.UsageError">UsageError</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ListPackets.userid_hint">userid_hint (ListPackets attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.username">username (Verify attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="V">V</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify.valid">valid (Verify attribute)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg._parsers.Verify">Verify (class in gnupg._parsers)</a>
+ </dt>
+
+ </dl></td>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg.GPG.verify">verify() (GPG method)</a>
+ </dt>
+
+
+ <dt><a href="gnupg.html#gnupg.GPG.verify_file">verify_file() (GPG method)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="W">W</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.Sign.what">what (Sign attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+<h2 id="X">X</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+ <td style="width: 33%" valign="top"><dl>
+
+ <dt><a href="gnupg.html#gnupg._parsers.ImportResult.x">x (ImportResult attribute)</a>
+ </dt>
+
+ </dl></td>
+</tr></table>
+
+
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="#" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/gnupg.html b/docs/_build/html/gnupg.html
new file mode 100644
index 0000000..63e8513
--- /dev/null
+++ b/docs/_build/html/gnupg.html
@@ -0,0 +1,2721 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>gnupg package &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: './',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="index.html" />
+ <link rel="prev" title="gnupg: Python Package Documentation" href="index.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="index.html" title="gnupg: Python Package Documentation"
+ accesskey="P">previous</a> |
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <div class="section" id="gnupg-package">
+<h1>gnupg package<a class="headerlink" href="#gnupg-package" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="gnupg-module">
+<h2>gnupg module<a class="headerlink" href="#gnupg-module" title="Permalink to this headline">¶</a></h2>
+<p>This module contains public classes for working with <a class="reference external" href="http://gnupg.org">GnuPG</a>. To get started,
+do:</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">()</span>
+</pre></div>
+</div>
+<span class="target" id="module-gnupg"></span><dl class="class">
+<dt id="gnupg.GPG">
+<em class="property">class </em><tt class="descname">GPG</tt><big>(</big><em>binary=None</em>, <em>homedir=None</em>, <em>verbose=False</em>, <em>use_agent=False</em>, <em>keyring=None</em>, <em>secring=None</em>, <em>options=None</em><big>)</big><a class="headerlink" href="#gnupg.GPG" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <a class="reference internal" href="#gnupg._meta.GPGBase" title="gnupg._meta.GPGBase"><tt class="xref py py-class docutils literal"><span class="pre">gnupg._meta.GPGBase</span></tt></a></p>
+<p>Python interface for handling interactions with GnuPG, including keyfile
+generation, keyring maintainance, import and export, encryption and
+decryption, sending to and recieving from keyservers, and signing and
+verification.</p>
+<p>Initialize a GnuPG process wrapper.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>binary</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Name for GnuPG binary executable. If the absolute
+path is not given, the environment variable
+<tt class="docutils literal"><span class="pre">$PATH</span></tt> is searched for the executable and
+checked that the real uid/gid of the user has
+sufficient permissions.</li>
+<li><strong>homedir</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Full pathname to directory containing the public
+and private keyrings. Default is whatever GnuPG
+defaults to.</li>
+<li><strong>verbose</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">int</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">bool</span></tt></a>) &#8211; String or numeric value to pass to GnuPG&#8217;s
+<tt class="docutils literal"><span class="pre">--debug-level</span></tt> option. See the GnuPG man page for
+the list of valid options. If False, debug output is
+not generated by the GnuPG binary. If True, defaults
+to <tt class="docutils literal"><span class="pre">--debug-level</span> <span class="pre">basic.</span></tt></li>
+<li><strong>keyring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Name of keyring file containing public key data.
+If unspecified, defaults to <tt class="file docutils literal"><span class="pre">pubring.gpg</span></tt> in
+the <strong>homedir</strong> directory.</li>
+<li><strong>secring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Name of alternative secret keyring file to use. If
+left unspecified, this will default to using
+<tt class="file docutils literal"><span class="pre">secring.gpg</span></tt> in the <strong>homedir</strong> directory,
+and create that file if it does not exist.</li>
+<li><strong>options</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; A list of additional options to pass to the GnuPG
+binary.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">A <a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></tt></a> with explanation message
+if there is a problem invoking GnuPG.</p>
+</td>
+</tr>
+</tbody>
+</table>
+<p>Example:</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="go">GnuPG logging disabled...</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&#39;doctests&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span><span class="o">.</span><span class="n">keyring</span>
+<span class="go">&#39;./doctests/pubring.gpg&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span><span class="o">.</span><span class="n">secring</span>
+<span class="go">&#39;./doctests/secring.gpg&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span><span class="o">.</span><span class="n">use_agent</span>
+<span class="go">False</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span><span class="o">.</span><span class="n">binary</span>
+<span class="go">&#39;/usr/bin/gpg&#39;</span>
+</pre></div>
+</div>
+<dl class="attribute">
+<dt id="gnupg.GPG._batch_limit">
+<tt class="descname">_batch_limit</tt><em class="property"> = 25</em><a class="headerlink" href="#gnupg.GPG._batch_limit" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG._create_trustdb">
+<tt class="descname">_create_trustdb</tt><big>(</big><big>)</big><a class="headerlink" href="#gnupg.GPG._create_trustdb" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create the trustdb file in our homedir, if it doesn&#8217;t exist.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG._export_ownertrust">
+<tt class="descname">_export_ownertrust</tt><big>(</big><em>trustdb=None</em><big>)</big><a class="headerlink" href="#gnupg.GPG._export_ownertrust" title="Permalink to this definition">¶</a></dt>
+<dd><p>Export ownertrust to a trustdb file.</p>
+<p>If there is already a file named <tt class="file docutils literal"><span class="pre">trustdb.gpg</span></tt> in the current GnuPG
+homedir, it will be renamed to <tt class="file docutils literal"><span class="pre">trustdb.gpg.bak</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>trustdb</strong> (<a class="reference external" href="http://docs.python.org/library/string.html#module-string" title="(in Python v2.7)"><em>string</em></a>) &#8211; The path to the trustdb.gpg file. If not given,
+defaults to <tt class="docutils literal"><span class="pre">'trustdb.gpg'</span></tt> in the current GnuPG
+homedir.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG._fix_trustdb">
+<tt class="descname">_fix_trustdb</tt><big>(</big><em>trustdb=None</em><big>)</big><a class="headerlink" href="#gnupg.GPG._fix_trustdb" title="Permalink to this definition">¶</a></dt>
+<dd><p>Attempt to repair a broken trustdb.gpg file.</p>
+<p>GnuPG&gt;=2.0.x has this magical-seeming flag: <cite>&#8211;fix-trustdb</cite>. You&#8217;d think
+it would fix the the trustdb. Hah! It doesn&#8217;t. Here&#8217;s what it does
+instead:</p>
+<div class="highlight-python"><div class="highlight"><pre>(gpg)~/code/python-gnupg $ gpg2 --fix-trustdb
+gpg: You may try to re-create the trustdb using the commands:
+gpg: cd ~/.gnupg
+gpg: gpg2 --export-ownertrust &gt; otrust.tmp
+gpg: rm trustdb.gpg
+gpg: gpg2 --import-ownertrust &lt; otrust.tmp
+gpg: If that does not work, please consult the manual
+</pre></div>
+</div>
+<p>Brilliant piece of software engineering right there.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>trustdb</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The path to the trustdb.gpg file. If not given,
+defaults to <tt class="file docutils literal"><span class="pre">trustdb.gpg</span></tt> in the current GnuPG
+homedir.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG._import_ownertrust">
+<tt class="descname">_import_ownertrust</tt><big>(</big><em>trustdb=None</em><big>)</big><a class="headerlink" href="#gnupg.GPG._import_ownertrust" title="Permalink to this definition">¶</a></dt>
+<dd><p>Import ownertrust from a trustdb file.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>trustdb</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The path to the trustdb.gpg file. If not given,
+defaults to <tt class="file docutils literal"><span class="pre">trustdb.gpg</span></tt> in the current GnuPG
+homedir.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.decrypt">
+<tt class="descname">decrypt</tt><big>(</big><em>message</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#gnupg.GPG.decrypt" title="Permalink to this definition">¶</a></dt>
+<dd><p>Decrypt the contents of a string or file-like object <tt class="docutils literal"><span class="pre">message</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>message</strong> (file or str or <a class="reference external" href="http://docs.python.org/library/io.html#io.BytesIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">io.BytesIO</span></tt></a>) &#8211; A string or file-like object to decrypt.</li>
+<li><strong>always_trust</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; Instruct GnuPG to ignore trust checks.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The passphrase for the secret key used for decryption.</li>
+<li><strong>output</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A filename to write the decrypted output to.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.decrypt_file">
+<tt class="descname">decrypt_file</tt><big>(</big><em>filename</em>, <em>always_trust=False</em>, <em>passphrase=None</em>, <em>output=None</em><big>)</big><a class="headerlink" href="#gnupg.GPG.decrypt_file" title="Permalink to this definition">¶</a></dt>
+<dd><p>Decrypt the contents of a file-like object <tt class="docutils literal"><span class="pre">filename</span></tt> .</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>filename</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A file-like object to decrypt.</li>
+<li><strong>always_trust</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; Instruct GnuPG to ignore trust checks.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The passphrase for the secret key used for decryption.</li>
+<li><strong>output</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A filename to write the decrypted output to.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.delete_keys">
+<tt class="descname">delete_keys</tt><big>(</big><em>fingerprints</em>, <em>secret=False</em>, <em>subkeys=False</em><big>)</big><a class="headerlink" href="#gnupg.GPG.delete_keys" title="Permalink to this definition">¶</a></dt>
+<dd><p>Delete a key, or list of keys, from the current keyring.</p>
+<p>The keys must be referred to by their full fingerprints for GnuPG to
+delete them. If <tt class="docutils literal"><span class="pre">secret=True</span></tt>, the corresponding secret keyring will
+be deleted from <a class="reference internal" href="#gnupg._parsers.GenKey.secring" title="gnupg._parsers.GenKey.secring"><tt class="xref py py-obj docutils literal"><span class="pre">secring</span></tt></a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>fingerprints</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">list</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/functions.html#tuple" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">tuple</span></tt></a>) &#8211; A string, or a list/tuple of strings,
+representing the fingerprint(s) for the key(s)
+to delete.</li>
+<li><strong>secret</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, delete the corresponding secret key(s)
+also. (default: False)</li>
+<li><strong>subkeys</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, delete the secret subkey first, then the
+public key. (default: False) Same as:
+<strong class="command">$gpg &#8211;delete-secret-and-public-key 0x12345678</strong>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.encrypt">
+<tt class="descname">encrypt</tt><big>(</big><em>data</em>, <em>*recipients</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#gnupg.GPG.encrypt" title="Permalink to this definition">¶</a></dt>
+<dd><p>Encrypt the message contained in <tt class="docutils literal"><span class="pre">data</span></tt> to <tt class="docutils literal"><span class="pre">recipients</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>data</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The file or bytestream to encrypt.</li>
+<li><strong>recipients</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The recipients to encrypt to. Recipients must
+be specified keyID/fingerprint. Care should be taken in Python2.x
+to make sure that the given fingerprint is in fact a string and
+not a unicode object.</li>
+<li><strong>default_key</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The keyID/fingerprint of the key to use for
+signing. If given, <tt class="docutils literal"><span class="pre">data</span></tt> will be encrypted and signed.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; If given, and <tt class="docutils literal"><span class="pre">default_key</span></tt> is also given,
+use this passphrase to unlock the secret portion of the
+<tt class="docutils literal"><span class="pre">default_key</span></tt> to sign the encrypted <tt class="docutils literal"><span class="pre">data</span></tt>. Otherwise, if
+<tt class="docutils literal"><span class="pre">default_key</span></tt> is not given, but <tt class="docutils literal"><span class="pre">symmetric=True</span></tt>, then use
+this passphrase as the passphrase for symmetric
+encryption. Signing and symmetric encryption should <em>not</em> be
+combined when sending the <tt class="docutils literal"><span class="pre">data</span></tt> to other recipients, else the
+passphrase to the secret key would be shared with them.</li>
+<li><strong>armor</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, ascii armor the output; otherwise, the
+output will be in binary format. (Default: True)</li>
+<li><strong>encrypt</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, encrypt the <tt class="docutils literal"><span class="pre">data</span></tt> using the
+<tt class="docutils literal"><span class="pre">recipients</span></tt> public keys. (Default: True)</li>
+<li><strong>symmetric</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, encrypt the <tt class="docutils literal"><span class="pre">data</span></tt> to <tt class="docutils literal"><span class="pre">recipients</span></tt>
+using a symmetric key. See the <tt class="docutils literal"><span class="pre">passphrase</span></tt> parameter. Symmetric
+encryption and public key encryption can be used simultaneously,
+and will result in a ciphertext which is decryptable with either
+the symmetric <tt class="docutils literal"><span class="pre">passphrase</span></tt> or one of the corresponding private
+keys.</li>
+<li><strong>always_trust</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, ignore trust warnings on recipient
+keys. If False, display trust warnings. (default: True)</li>
+<li><strong>output</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The output file to write to. If not specified, the
+encrypted output is returned, and thus should be stored as an
+object in Python. For example:</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">shutil</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s">&quot;doctests&quot;</span><span class="p">):</span>
+<span class="gp">... </span> <span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key_settings</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">(</span><span class="n">key_type</span><span class="o">=</span><span class="s">&#39;RSA&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="n">key_length</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span>
+<span class="gp">... </span> <span class="n">key_usage</span><span class="o">=</span><span class="s">&#39;ESCA&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="n">passphrase</span><span class="o">=</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">key_settings</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">message</span> <span class="o">=</span> <span class="s">&quot;The crow flies at midnight.&quot;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">encrypted</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">encrypt</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">key</span><span class="o">.</span><span class="n">printprint</span><span class="p">))</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">encrypted</span> <span class="o">!=</span> <span class="n">message</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">encrypted</span><span class="o">.</span><span class="n">isspace</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">decrypted</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">decrypt</span><span class="p">(</span><span class="n">encrypted</span><span class="p">))</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">decrypted</span><span class="o">.</span><span class="n">isspace</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">decrypted</span>
+<span class="go">&#39;The crow flies at midnight.&#39;</span>
+</pre></div>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>cipher_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The cipher algorithm to use. To see available
+algorithms with your version of GnuPG, do:
+<strong class="command">$ gpg &#8211;with-colons &#8211;list-config ciphername</strong>.
+The default <tt class="docutils literal"><span class="pre">cipher_algo</span></tt>, if unspecified, is <tt class="docutils literal"><span class="pre">'AES256'</span></tt>.</li>
+<li><strong>digest_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The hash digest to use. Again, to see which
+hashes your GnuPG is capable of using, do:
+<strong class="command">$ gpg &#8211;with-colons &#8211;list-config digestname</strong>.
+The default, if unspecified, is <tt class="docutils literal"><span class="pre">'SHA512'</span></tt>.</li>
+<li><strong>compress_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The compression algorithm to use. Can be one
+of <tt class="docutils literal"><span class="pre">'ZLIB'</span></tt>, <tt class="docutils literal"><span class="pre">'BZIP2'</span></tt>, <tt class="docutils literal"><span class="pre">'ZIP'</span></tt>, or <tt class="docutils literal"><span class="pre">'Uncompressed'</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<div class="admonition seealso">
+<p class="first admonition-title">See also</p>
+<p class="last"><a class="reference internal" href="#gnupg._meta.GPGBase._encrypt" title="gnupg._meta.GPGBase._encrypt"><tt class="xref py py-meth docutils literal"><span class="pre">_encrypt()</span></tt></a></p>
+</div>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.export_keys">
+<tt class="descname">export_keys</tt><big>(</big><em>keyids</em>, <em>secret=False</em>, <em>subkeys=False</em><big>)</big><a class="headerlink" href="#gnupg.GPG.export_keys" title="Permalink to this definition">¶</a></dt>
+<dd><p>Export the indicated <tt class="docutils literal"><span class="pre">keyids</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>keyids</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A keyid or fingerprint in any format that GnuPG will
+accept.</li>
+<li><strong>secret</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, export only the secret key.</li>
+<li><strong>subkeys</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, export the secret subkeys.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.gen_key">
+<tt class="descname">gen_key</tt><big>(</big><em>input</em><big>)</big><a class="headerlink" href="#gnupg.GPG.gen_key" title="Permalink to this definition">¶</a></dt>
+<dd><p>Generate a GnuPG key through batch file key generation. See
+<a class="reference internal" href="#gnupg.GPG.gen_key_input" title="gnupg.GPG.gen_key_input"><tt class="xref py py-meth docutils literal"><span class="pre">GPG.gen_key_input()</span></tt></a> for creating the control input.</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key_input</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">key_input</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">key</span><span class="o">.</span><span class="n">fingerprint</span>
+</pre></div>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>input</strong> (<a class="reference external" href="http://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><em>dict</em></a>) &#8211; A dictionary of parameters and values for the new
+key.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The result mapping with details of the new key, which is a
+<a class="reference internal" href="#gnupg._parsers.GenKey" title="gnupg._parsers.GenKey"><tt class="xref py py-class docutils literal"><span class="pre">GenKey</span></tt></a> object.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.gen_key_input">
+<tt class="descname">gen_key_input</tt><big>(</big><em>separate_keyring=False</em>, <em>save_batchfile=False</em>, <em>testing=False</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#gnupg.GPG.gen_key_input" title="Permalink to this definition">¶</a></dt>
+<dd><p>Generate a batch file for input to <a class="reference internal" href="#gnupg.GPG.gen_key" title="gnupg.GPG.gen_key"><tt class="xref py py-meth docutils literal"><span class="pre">gen_key()</span></tt></a>.</p>
+<p>The GnuPG batch file key generation feature allows unattended key
+generation by creating a file with special syntax and then providing it
+to: <strong class="command">gpg &#8211;gen-key &#8211;batch</strong>. Batch files look like this:</p>
+<div class="line-block">
+<div class="line">Name-Real: Alice</div>
+<div class="line">Name-Email: <a class="reference external" href="mailto:alice&#37;&#52;&#48;inter&#46;net">alice<span>&#64;</span>inter<span>&#46;</span>net</a></div>
+<div class="line">Expire-Date: 2014-04-01</div>
+<div class="line">Key-Type: RSA</div>
+<div class="line">Key-Length: 4096</div>
+<div class="line">Key-Usage: cert</div>
+<div class="line">Subkey-Type: RSA</div>
+<div class="line">Subkey-Length: 4096</div>
+<div class="line">Subkey-Usage: encrypt,sign,auth</div>
+<div class="line">Passphrase: sekrit</div>
+<div class="line">%pubring foo.gpg</div>
+<div class="line">%secring sec.gpg</div>
+<div class="line">%commit</div>
+</div>
+<p>which is what this function creates for you. All of the available,
+non-control parameters are detailed below (control parameters are the
+ones which begin with a &#8216;%&#8217;). For example, to generate the batch file
+example above, use like this:</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="go">GnuPG logging disabled...</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">print_function</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&#39;doctests&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">alice</span> <span class="o">=</span> <span class="p">{</span> <span class="s">&#39;name_real&#39;</span><span class="p">:</span> <span class="s">&#39;Alice&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;name_email&#39;</span><span class="p">:</span> <span class="s">&#39;alice@inter.net&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;expire_date&#39;</span><span class="p">:</span> <span class="s">&#39;2014-04-01&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;key_type&#39;</span><span class="p">:</span> <span class="s">&#39;RSA&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;key_length&#39;</span><span class="p">:</span> <span class="mi">4096</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;key_usage&#39;</span><span class="p">:</span> <span class="s">&#39;&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;subkey_type&#39;</span><span class="p">:</span> <span class="s">&#39;RSA&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;subkey_length&#39;</span><span class="p">:</span> <span class="mi">4096</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;subkey_usage&#39;</span><span class="p">:</span> <span class="s">&#39;encrypt,sign,auth&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="s">&#39;passphrase&#39;</span><span class="p">:</span> <span class="s">&#39;sekrit&#39;</span><span class="p">}</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">alice_input</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">(</span><span class="o">**</span><span class="n">alice</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span><span class="p">(</span><span class="n">alice_input</span><span class="p">)</span>
+<span class="go">Key-Type: RSA</span>
+<span class="go">Subkey-Type: RSA</span>
+<span class="go">Subkey-Usage: encrypt,sign,auth</span>
+<span class="go">Expire-Date: 2014-04-01</span>
+<span class="go">Passphrase: sekrit</span>
+<span class="go">Name-Real: Alice</span>
+<span class="go">Name-Email: alice@inter.net</span>
+<span class="go">Key-Length: 4096</span>
+<span class="go">Subkey-Length: 4096</span>
+<span class="go">%pubring ./doctests/alice.pubring.gpg</span>
+<span class="go">%secring ./doctests/alice.secring.gpg</span>
+<span class="go">%commit</span>
+
+<span class="gp">&gt;&gt;&gt; </span><span class="n">alice_key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">alice_input</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">alice_key</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">alice_key</span><span class="o">.</span><span class="n">fingerprint</span> <span class="ow">is</span> <span class="ow">not</span> <span class="bp">None</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">message</span> <span class="o">=</span> <span class="s">&quot;no one else can read my sekrit message&quot;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">encrypted</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">encrypt</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">alice_key</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">encrypted</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="nb">str</span><span class="p">)</span>
+</pre></div>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>separate_keyring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; Specify for the new key to be written to
+a separate pubring.gpg and secring.gpg. If True,
+<a class="reference internal" href="#gnupg.GPG.gen_key" title="gnupg.GPG.gen_key"><tt class="xref py py-meth docutils literal"><span class="pre">gen_key()</span></tt></a> will automatically rename the separate
+keyring and secring to whatever the fingerprint of the generated
+key ends up being, suffixed with &#8216;.pubring&#8217; and &#8216;.secring&#8217;
+respectively.</li>
+<li><strong>save_batchfile</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; Save a copy of the generated batch file to
+disk in a file named &lt;name_real&gt;.batch, where &lt;name_real&gt; is the
+<tt class="docutils literal"><span class="pre">name_real</span></tt> parameter stripped of punctuation, spaces, and
+non-ascii characters.</li>
+<li><strong>testing</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; Uses a faster, albeit insecure random number
+generator to create keys. This should only be used for testing
+purposes, for keys which are going to be created and then soon
+after destroyed, and never for the generation of actual use keys.</li>
+<li><strong>name_real</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The name field of the UID in the generated key.</li>
+<li><strong>name_comment</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The comment in the UID of the generated key.</li>
+<li><strong>name_email</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The email in the UID of the generated key.
+(default: <tt class="docutils literal"><span class="pre">$USER</span></tt> &#64; <strong class="command">hostname</strong> ) Remember to use UTF-8
+encoding for the entirety of the UID. At least one of
+<tt class="docutils literal"><span class="pre">name_real</span></tt>, <tt class="docutils literal"><span class="pre">name_comment</span></tt>, or <tt class="docutils literal"><span class="pre">name_email</span></tt> must be
+provided, or else no user ID is created.</li>
+<li><strong>key_type</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; One of &#8216;RSA&#8217;, &#8216;DSA&#8217;, &#8216;ELG-E&#8217;, or &#8216;default&#8217;.
+(default: &#8216;RSA&#8217;, if using GnuPG v1.x, otherwise &#8216;default&#8217;) Starts
+a new parameter block by giving the type of the primary key. The
+algorithm must be capable of signing. This is a required
+parameter. The algorithm may either be an OpenPGP algorithm number
+or a string with the algorithm name. The special value ‘default’
+may be used for algo to create the default key type; in this case
+a <tt class="docutils literal"><span class="pre">key_usage</span></tt> should not be given and &#8216;default&#8217; must also be
+used for <tt class="docutils literal"><span class="pre">subkey_type</span></tt>.</li>
+<li><strong>key_length</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) &#8211; The requested length of the generated key in
+bits. (Default: 4096)</li>
+<li><strong>key_grip</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; hexstring This is an optional hexidecimal string
+which is used to generate a CSR or certificate for an already
+existing key. <tt class="docutils literal"><span class="pre">key_length</span></tt> will be ignored if this parameter
+is given.</li>
+<li><strong>key_usage</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Space or comma delimited string of key
+usages. Allowed values are ‘encrypt’, ‘sign’, and ‘auth’. This is
+used to generate the key flags. Please make sure that the
+algorithm is capable of this usage. Note that OpenPGP requires
+that all primary keys are capable of certification, so no matter
+what usage is given here, the ‘cert’ flag will be on. If no
+‘Key-Usage’ is specified and the ‘Key-Type’ is not ‘default’, all
+allowed usages for that particular algorithm are used; if it is
+not given but ‘default’ is used the usage will be ‘sign’.</li>
+<li><strong>subkey_type</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; This generates a secondary key
+(subkey). Currently only one subkey can be handled. See also
+<tt class="docutils literal"><span class="pre">key_type</span></tt> above.</li>
+<li><strong>subkey_length</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) &#8211; The length of the secondary subkey in bits.</li>
+<li><strong>subkey_usage</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Key usage for a subkey; similar to
+<tt class="docutils literal"><span class="pre">key_usage</span></tt>.</li>
+<li><strong>expire_date</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">int</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>) &#8211; Can be specified as an iso-date or as
+&lt;int&gt;[d|w|m|y] Set the expiration date for the key (and the
+subkey). It may either be entered in ISO date format (2000-08-15)
+or as number of days, weeks, month or years. The special notation
+&#8220;seconds=N&#8221; is also allowed to directly give an Epoch
+value. Without a letter days are assumed. Note that there is no
+check done on the overflow of the type used by OpenPGP for
+timestamps. Thus you better make sure that the given value make
+sense. Although OpenPGP works with time intervals, GnuPG uses an
+absolute value internally and thus the last year we can represent
+is 2105.</li>
+<li><strong>creation_date</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Set the creation date of the key as stored
+in the key information and which is also part of the fingerprint
+calculation. Either a date like &#8220;1986-04-26&#8221; or a full timestamp
+like &#8220;19860426T042640&#8221; may be used. The time is considered to be
+UTC. If it is not given the current time is used.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The passphrase for the new key. The default is
+to not use any passphrase. Note that GnuPG&gt;=2.1.x will not allow
+you to specify a passphrase for batch key generation &#8211; GnuPG will
+ignore the <strong>passphrase</strong> parameter, stop, and ask the user for
+the new passphrase. However, we can put the command
+<tt class="docutils literal"><span class="pre">%no-protection</span></tt> into the batch key generation file to allow a
+passwordless key to be created, which can then have its passphrase
+set later with <tt class="docutils literal"><span class="pre">--edit-key</span></tt>.</li>
+<li><strong>preferences</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Set the cipher, hash, and compression
+preference values for this key. This expects the same type of
+string as the sub-command ‘setpref’ in the &#8211;edit-key menu.</li>
+<li><strong>revoker</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Should be given as &#8216;algo:fpr&#8217; (case sensitive).
+Add a designated revoker to the generated key. Algo is the public
+key algorithm of the designated revoker (i.e. RSA=1, DSA=17, etc.)
+fpr is the fingerprint of the designated revoker. The optional
+‘sensitive’ flag marks the designated revoker as sensitive
+information. Only v4 keys may be designated revokers.</li>
+<li><strong>keyserver</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; This is an optional parameter that specifies the
+preferred keyserver URL for the key.</li>
+<li><strong>handle</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; This is an optional parameter only used with the
+status lines <tt class="docutils literal"><span class="pre">KEY_CREATED</span></tt> and <tt class="docutils literal"><span class="pre">KEY_NOT_CREATED</span></tt>. string may
+be up to 100 characters and should not contain spaces. It is
+useful for batch key generation to associate a key parameter block
+with a status line.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">str</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A suitable input string for the <a class="reference internal" href="#gnupg.GPG.gen_key" title="gnupg.GPG.gen_key"><tt class="xref py py-meth docutils literal"><span class="pre">GPG.gen_key()</span></tt></a> method,
+the latter of which will create the new keypair.</p>
+</td>
+</tr>
+</tbody>
+</table>
+<p>See <a class="reference external" href="http://www.gnupg.org/documentation/manuals/gnupg-devel/Unattended-GPG-key-generation.html">this GnuPG Manual section</a> for more details.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.import_keys">
+<tt class="descname">import_keys</tt><big>(</big><em>key_data</em><big>)</big><a class="headerlink" href="#gnupg.GPG.import_keys" title="Permalink to this definition">¶</a></dt>
+<dd><p>Import the key_data into our keyring.</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">shutil</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">inpt</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key1</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">print1</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">key1</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">pubkey1</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">export_keys</span><span class="p">(</span><span class="n">print1</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">seckey1</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">export_keys</span><span class="p">(</span><span class="n">print1</span><span class="p">,</span><span class="n">secret</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key2</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">inpt</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">print2</span> <span class="o">=</span> <span class="n">key2</span><span class="o">.</span><span class="n">fingerprint</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">seckeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">(</span><span class="n">secret</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">pubkeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">seckeys</span><span class="o">.</span><span class="n">fingerprints</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">pubkeys</span><span class="o">.</span><span class="n">fingerprints</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">delete_keys</span><span class="p">(</span><span class="n">print1</span><span class="p">))</span>
+<span class="go">&#39;Must delete secret key first&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">delete_keys</span><span class="p">(</span><span class="n">print1</span><span class="p">,</span><span class="n">secret</span><span class="o">=</span><span class="bp">True</span><span class="p">))</span>
+<span class="go">&#39;ok&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">delete_keys</span><span class="p">(</span><span class="n">print1</span><span class="p">))</span>
+<span class="go">&#39;ok&#39;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">pubkeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">pubkeys</span><span class="o">.</span><span class="n">fingerprints</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">import_keys</span><span class="p">(</span><span class="n">pubkey1</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">pubkeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">seckeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">(</span><span class="n">secret</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">seckeys</span><span class="o">.</span><span class="n">fingerprints</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">pubkeys</span><span class="o">.</span><span class="n">fingerprints</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">import_keys</span><span class="p">(</span><span class="n">seckey1</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">result</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">seckeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">(</span><span class="n">secret</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">seckeys</span><span class="o">.</span><span class="n">fingerprints</span>
+</pre></div>
+</div>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.is_gpg1">
+<tt class="descname">is_gpg1</tt><big>(</big><big>)</big><a class="headerlink" href="#gnupg.GPG.is_gpg1" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns true if using GnuPG &lt;= 1.x.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.is_gpg2">
+<tt class="descname">is_gpg2</tt><big>(</big><big>)</big><a class="headerlink" href="#gnupg.GPG.is_gpg2" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns true if using GnuPG &gt;= 2.x.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.list_keys">
+<tt class="descname">list_keys</tt><big>(</big><em>secret=False</em><big>)</big><a class="headerlink" href="#gnupg.GPG.list_keys" title="Permalink to this definition">¶</a></dt>
+<dd><p>List the keys currently in the keyring.</p>
+<p>The GnuPG option &#8216;&#8211;show-photos&#8217;, according to the GnuPG manual, &#8220;does
+not work with &#8211;with-colons&#8221;, but since we can&#8217;t rely on all versions
+of GnuPG to explicitly handle this correctly, we should probably
+include it in the args.</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">shutil</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">input</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="nb">input</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">print1</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">fingerprint</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">result</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="nb">input</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">print2</span> <span class="o">=</span> <span class="n">result</span><span class="o">.</span><span class="n">fingerprint</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">pubkeys</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">list_keys</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">print1</span> <span class="ow">in</span> <span class="n">pubkeys</span><span class="o">.</span><span class="n">fingerprints</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">print2</span> <span class="ow">in</span> <span class="n">pubkeys</span><span class="o">.</span><span class="n">fingerprints</span>
+</pre></div>
+</div>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.list_packets">
+<tt class="descname">list_packets</tt><big>(</big><em>raw_data</em><big>)</big><a class="headerlink" href="#gnupg.GPG.list_packets" title="Permalink to this definition">¶</a></dt>
+<dd><p>List the packet contents of a file.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.list_sigs">
+<tt class="descname">list_sigs</tt><big>(</big><em>*keyids</em><big>)</big><a class="headerlink" href="#gnupg.GPG.list_sigs" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the signatures for each of the <tt class="docutils literal"><span class="pre">keyids</span></tt>.</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key_input</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">key_input</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">key</span><span class="o">.</span><span class="n">fingerprint</span>
+</pre></div>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">dict</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dictionary whose keys are the original keyid parameters,
+and whose values are lists of signatures.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.recv_keys">
+<tt class="descname">recv_keys</tt><big>(</big><em>*keyids</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#gnupg.GPG.recv_keys" title="Permalink to this definition">¶</a></dt>
+<dd><p>Import keys from a keyserver.</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">recv_keys</span><span class="p">(</span><span class="s">&#39;hkp://pgp.mit.edu&#39;</span><span class="p">,</span> <span class="s">&#39;3FF0DB166A7476EA&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">key</span>
+</pre></div>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>keyids</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; Each <tt class="docutils literal"><span class="pre">keyids</span></tt> argument should be a string
+containing a keyid to request.</li>
+<li><strong>keyserver</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The keyserver to request the <tt class="docutils literal"><span class="pre">keyids</span></tt> from;
+defaults to <cite>gnupg.GPG.keyserver</cite>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.sign">
+<tt class="descname">sign</tt><big>(</big><em>data</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#gnupg.GPG.sign" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create a signature for a message string or file.</p>
+<p>Note that this method is not for signing other keys. (In GnuPG&#8217;s
+terms, what we all usually call &#8216;keysigning&#8217; is actually termed
+&#8216;certification&#8217;...) Even though they are cryptographically the same
+operation, GnuPG differentiates between them, presumedly because these
+operations are also the same as the decryption operation. If the
+<tt class="docutils literal"><span class="pre">key_usage``s</span> <span class="pre">``C</span> <span class="pre">(certification)</span></tt>, <tt class="docutils literal"><span class="pre">S</span> <span class="pre">(sign)</span></tt>, and <tt class="docutils literal"><span class="pre">E</span>
+<span class="pre">(encrypt)</span></tt>, were all the same key, the key would &#8220;wear down&#8221; through
+frequent signing usage &#8211; since signing data is usually done often &#8211;
+meaning that the secret portion of the keypair, also used for
+decryption in this scenario, would have a statistically higher
+probability of an adversary obtaining an oracle for it (or for a
+portion of the rounds in the cipher algorithm, depending on the family
+of cryptanalytic attack used).</p>
+<p>In simpler terms: this function isn&#8217;t for signing your friends&#8217; keys,
+it&#8217;s for something like signing an email.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>data</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/functions.html#file" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">file</span></tt></a>) &#8211; A string or file stream to sign.</li>
+<li><strong>default_key</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The key to sign with.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The passphrase to pipe to stdin.</li>
+<li><strong>clearsign</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, create a cleartext signature.</li>
+<li><strong>detach</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, create a detached signature.</li>
+<li><strong>binary</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, do not ascii armour the output.</li>
+<li><strong>digest_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The hash digest to use. Again, to see which
+hashes your GnuPG is capable of using, do:
+<strong class="command">$ gpg &#8211;with-colons &#8211;list-config digestname</strong>.
+The default, if unspecified, is <tt class="docutils literal"><span class="pre">'SHA512'</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.verify">
+<tt class="descname">verify</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#gnupg.GPG.verify" title="Permalink to this definition">¶</a></dt>
+<dd><p>Verify the signature on the contents of the string <tt class="docutils literal"><span class="pre">data</span></tt>.</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="nb">input</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">(</span><span class="n">Passphrase</span><span class="o">=</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="nb">input</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">key</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">sig</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="s">&#39;hello&#39;</span><span class="p">,</span><span class="n">keyid</span><span class="o">=</span><span class="n">key</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">,</span><span class="n">passphrase</span><span class="o">=</span><span class="s">&#39;bar&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">sig</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">sig</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="s">&#39;hello&#39;</span><span class="p">,</span><span class="n">keyid</span><span class="o">=</span><span class="n">key</span><span class="o">.</span><span class="n">fingerprint</span><span class="p">,</span><span class="n">passphrase</span><span class="o">=</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">sig</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">verify</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">verify</span><span class="p">(</span><span class="n">sig</span><span class="o">.</span><span class="n">data</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">verify</span>
+</pre></div>
+</div>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg.GPG.verify_file">
+<tt class="descname">verify_file</tt><big>(</big><em>file</em>, <em>sig_file=None</em><big>)</big><a class="headerlink" href="#gnupg.GPG.verify_file" title="Permalink to this definition">¶</a></dt>
+<dd><p>Verify the signature on the contents of a file or file-like
+object. Can handle embedded signatures as well as detached
+signatures. If using detached signatures, the file containing the
+detached signature should be specified as the <tt class="docutils literal"><span class="pre">sig_file</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>file</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#file" title="(in Python v2.7)"><em>file</em></a>) &#8211; A file descriptor object. Its type will be checked
+with <a class="reference internal" href="#gnupg._util._is_file" title="gnupg._util._is_file"><tt class="xref py py-func docutils literal"><span class="pre">_util._is_file()</span></tt></a>.</li>
+<li><strong>sig_file</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A file containing the GPG signature data for
+<tt class="docutils literal"><span class="pre">file</span></tt>. If given, <tt class="docutils literal"><span class="pre">file</span></tt> is verified via this detached
+signature.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+<div class="section" id="meta-module">
+<span id="meta"></span><h2>meta module<a class="headerlink" href="#meta-module" title="Permalink to this headline">¶</a></h2>
+<p>Contains the meta and base classes which <a class="reference internal" href="#gnupg.GPG" title="gnupg.GPG"><tt class="xref py py-class docutils literal"><span class="pre">gnupg.GPG</span></tt></a> inherits
+from. Mostly, you shouldn&#8217;t ever need to touch anything in here, unless you&#8217;re
+doing some serious hacking.</p>
+<span class="target" id="module-gnupg._meta"></span><p>Meta and base classes for hiding internal functions, and controlling
+attribute creation and handling.</p>
+<dl class="class">
+<dt id="gnupg._meta.GPGMeta">
+<em class="property">class </em><tt class="descname">GPGMeta</tt><a class="reference internal" href="_modules/gnupg/_meta.html#GPGMeta"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGMeta" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">type</span></tt></p>
+<p>Metaclass for changing the :meth:GPG.__init__ initialiser.</p>
+<p>Detects running gpg-agent processes and the presence of a pinentry
+program, and disables pinentry so that python-gnupg can write the
+passphrase to the controlled GnuPG process without killing the agent.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name" colspan="2">Attr _agent_proc:</th></tr>
+<tr class="field-odd field"><td>&nbsp;</td><td class="field-body">If a <strong class="program">gpg-agent</strong> process is currently running
+for the effective userid, then <strong>_agent_proc</strong> will be
+set to a <tt class="docutils literal"><span class="pre">psutil.Process</span></tt> for that process.</td>
+</tr>
+</tbody>
+</table>
+<dl class="staticmethod">
+<dt id="gnupg._meta.GPGMeta.__new__">
+<em class="property">static </em><tt class="descname">__new__</tt><big>(</big><em>name</em>, <em>bases</em>, <em>attrs</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGMeta.__new__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGMeta.__new__" title="Permalink to this definition">¶</a></dt>
+<dd><p>Construct the initialiser for GPG</p>
+</dd></dl>
+
+<dl class="classmethod">
+<dt id="gnupg._meta.GPGMeta._find_agent">
+<em class="property">classmethod </em><tt class="descname">_find_agent</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGMeta._find_agent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGMeta._find_agent" title="Permalink to this definition">¶</a></dt>
+<dd><p>Discover if a gpg-agent process for the current euid is running.</p>
+<p>If there is a matching gpg-agent process, set a <tt class="xref py py-class docutils literal"><span class="pre">psutil.Process</span></tt>
+instance containing the gpg-agent process&#8217; information to
+<tt class="docutils literal"><span class="pre">cls._agent_proc</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if there exists a gpg-agent process running under the
+same effective user ID as that of this program. Otherwise,
+returns None.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._meta.GPGBase">
+<em class="property">class </em><tt class="descname">GPGBase</tt><big>(</big><em>binary=None</em>, <em>home=None</em>, <em>keyring=None</em>, <em>secring=None</em>, <em>use_agent=False</em>, <em>default_preference_list=None</em>, <em>verbose=False</em>, <em>options=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Base class for storing properties and controlling process initialisation.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name" colspan="2">Const _result_map:</th></tr>
+<tr class="field-odd field"><td>&nbsp;</td><td class="field-body">A <em>dict</em> containing classes from
+<a class="reference internal" href="#module-gnupg._parsers" title="gnupg._parsers"><tt class="xref py py-mod docutils literal"><span class="pre">_parsers</span></tt></a>, used for parsing results
+obtained from GnuPG commands.</td>
+</tr>
+<tr class="field-even field"><th class="field-name" colspan="2">Const _decode_errors:</th></tr>
+<tr class="field-even field"><td>&nbsp;</td><td class="field-body">How to handle encoding errors.</td>
+</tr>
+</tbody>
+</table>
+<p>Create a <tt class="docutils literal"><span class="pre">GPGBase</span></tt>.</p>
+<p>This class is used to set up properties for controlling the behaviour
+of configuring various options for GnuPG, such as setting GnuPG&#8217;s
+<strong>homedir</strong> , and the paths to its <strong>binary</strong> and <strong>keyring</strong> .</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Const binary:</th><td class="field-body"><p class="first">(<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>) The full path to the GnuPG binary.</p>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
+<li><strong>homedir</strong> &#8211; (<a class="reference internal" href="#gnupg._util.InheritableProperty" title="gnupg._util.InheritableProperty"><tt class="xref py py-class docutils literal"><span class="pre">InheritableProperty</span></tt></a>) The full
+path to the current setting for the GnuPG
+<tt class="docutils literal"><span class="pre">--homedir</span></tt>.</li>
+<li><strong>_generated_keys</strong> &#8211; (<a class="reference internal" href="#gnupg._util.InheritableProperty" title="gnupg._util.InheritableProperty"><tt class="xref py py-class docutils literal"><span class="pre">InheritableProperty</span></tt></a>)
+Controls setting the directory for storing any
+keys which are generated with
+<a class="reference internal" href="#gnupg.GPG.gen_key" title="gnupg.GPG.gen_key"><tt class="xref py py-meth docutils literal"><span class="pre">gen_key()</span></tt></a>.</li>
+<li><strong>keyring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The filename in <strong>homedir</strong> to use as the keyring
+file for public keys.</li>
+<li><strong>secring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The filename in <strong>homedir</strong> to use as the keyring
+file for secret keys.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<dl class="method">
+<dt id="gnupg._meta.GPGBase.__init__">
+<tt class="descname">__init__</tt><big>(</big><em>binary=None</em>, <em>home=None</em>, <em>keyring=None</em>, <em>secring=None</em>, <em>use_agent=False</em>, <em>default_preference_list=None</em>, <em>verbose=False</em>, <em>options=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase.__init__" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create a <tt class="docutils literal"><span class="pre">GPGBase</span></tt>.</p>
+<p>This class is used to set up properties for controlling the behaviour
+of configuring various options for GnuPG, such as setting GnuPG&#8217;s
+<strong>homedir</strong> , and the paths to its <strong>binary</strong> and <strong>keyring</strong> .</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Const binary:</th><td class="field-body"><p class="first">(<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>) The full path to the GnuPG binary.</p>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
+<li><strong>homedir</strong> &#8211; (<a class="reference internal" href="#gnupg._util.InheritableProperty" title="gnupg._util.InheritableProperty"><tt class="xref py py-class docutils literal"><span class="pre">InheritableProperty</span></tt></a>) The full
+path to the current setting for the GnuPG
+<tt class="docutils literal"><span class="pre">--homedir</span></tt>.</li>
+<li><strong>_generated_keys</strong> &#8211; (<a class="reference internal" href="#gnupg._util.InheritableProperty" title="gnupg._util.InheritableProperty"><tt class="xref py py-class docutils literal"><span class="pre">InheritableProperty</span></tt></a>)
+Controls setting the directory for storing any
+keys which are generated with
+<a class="reference internal" href="#gnupg.GPG.gen_key" title="gnupg.GPG.gen_key"><tt class="xref py py-meth docutils literal"><span class="pre">gen_key()</span></tt></a>.</li>
+<li><strong>keyring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The filename in <strong>homedir</strong> to use as the keyring
+file for public keys.</li>
+<li><strong>secring</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The filename in <strong>homedir</strong> to use as the keyring
+file for secret keys.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase.__remove_path__">
+<tt class="descname">__remove_path__</tt><big>(</big><em>prog=None</em>, <em>at_exit=True</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase.__remove_path__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase.__remove_path__" title="Permalink to this definition">¶</a></dt>
+<dd><p>Remove the directories containing a program from the system&#8217;s
+<tt class="docutils literal"><span class="pre">$PATH</span></tt>. If <tt class="docutils literal"><span class="pre">GPGBase.binary</span></tt> is in a directory being removed, it
+is linked to :<a class="reference external" href="file:'./gpg">file:&#8217;./gpg</a>&#8216; in the current directory.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>prog</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The program to remove from <tt class="docutils literal"><span class="pre">$PATH</span></tt>.</li>
+<li><strong>at_exit</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; Add the program back into the <tt class="docutils literal"><span class="pre">$PATH</span></tt> when the
+Python interpreter exits, and delete any symlinks
+to <tt class="docutils literal"><span class="pre">GPGBase.binary</span></tt> which were created.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._meta.GPGBase.default_preference_list">
+<tt class="descname">default_preference_list</tt><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase.default_preference_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase.default_preference_list" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the default preference list.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._meta.GPGBase.keyserver">
+<tt class="descname">keyserver</tt><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase.keyserver"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase.keyserver" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the current keyserver setting.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._homedir_getter">
+<tt class="descname">_homedir_getter</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._homedir_getter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._homedir_getter" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the directory currently being used as GnuPG&#8217;s homedir.</p>
+<p>If unspecified, use <tt class="file docutils literal"><span class="pre">~/.config/python-gnupg/</span></tt></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The absolute path to the current GnuPG homedir.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._homedir_setter">
+<tt class="descname">_homedir_setter</tt><big>(</big><em>directory</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._homedir_setter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._homedir_setter" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set the directory to use as GnuPG&#8217;s homedir.</p>
+<p>If unspecified, use $HOME/.config/python-gnupg. If specified, ensure
+that the <tt class="docutils literal"><span class="pre">directory</span></tt> does not contain various shell escape
+characters. If <tt class="docutils literal"><span class="pre">directory</span></tt> is not found, it will be automatically
+created. Lastly, the <tt class="docutils literal"><span class="pre">direcory</span></tt> will be checked that the EUID has
+read and write permissions for it.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>directory</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A relative or absolute path to the directory to
+use for storing/accessing GnuPG&#8217;s files, including
+keyrings and the trustdb.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></tt></a> if unable to find a suitable
+directory to use.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._meta.GPGBase.homedir">
+<tt class="descname">homedir</tt><a class="headerlink" href="#gnupg._meta.GPGBase.homedir" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._generated_keys_getter">
+<tt class="descname">_generated_keys_getter</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._generated_keys_getter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._generated_keys_getter" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the <tt class="docutils literal"><span class="pre">homedir</span></tt> subdirectory for storing generated keys.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The absolute path to the current GnuPG homedir.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._generated_keys_setter">
+<tt class="descname">_generated_keys_setter</tt><big>(</big><em>directory</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._generated_keys_setter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._generated_keys_setter" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set the directory for storing generated keys.</p>
+<p>If unspecified, use
+<a class="reference internal" href="#gnupg._meta.GPGBase.homedir" title="gnupg._meta.GPGBase.homedir"><tt class="xref py py-meth docutils literal"><span class="pre">homedir()</span></tt></a>/generated-keys. If specified,
+ensure that the <tt class="docutils literal"><span class="pre">directory</span></tt> does not contain various shell escape
+characters. If <tt class="docutils literal"><span class="pre">directory</span></tt> isn&#8217;t found, it will be automatically
+created. Lastly, the <tt class="docutils literal"><span class="pre">directory</span></tt> will be checked to ensure that the
+current EUID has read and write permissions for it.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>directory</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A relative or absolute path to the directory to
+use for storing/accessing GnuPG&#8217;s files, including keyrings and
+the trustdb.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></tt></a> if unable to find a suitable
+directory to use.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._meta.GPGBase._generated_keys">
+<tt class="descname">_generated_keys</tt><a class="headerlink" href="#gnupg._meta.GPGBase._generated_keys" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._make_args">
+<tt class="descname">_make_args</tt><big>(</big><em>args</em>, <em>passphrase=False</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._make_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._make_args" title="Permalink to this definition">¶</a></dt>
+<dd><p>Make a list of command line elements for GPG.</p>
+<p>The value of <tt class="docutils literal"><span class="pre">args</span></tt> will be appended only if it passes the checks in
+<a class="reference internal" href="#gnupg._parsers._sanitise" title="gnupg._parsers._sanitise"><tt class="xref py py-func docutils literal"><span class="pre">gnupg._parsers._sanitise()</span></tt></a>. The <tt class="docutils literal"><span class="pre">passphrase</span></tt> argument needs to
+be True if a passphrase will be sent to GnuPG, else False.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>args</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; A list of strings of options and flags to pass to
+<tt class="docutils literal"><span class="pre">GPG.binary</span></tt>. This is input safe, meaning that
+these values go through strict checks (see
+<tt class="docutils literal"><span class="pre">parsers._sanitise_list</span></tt>) before being passed to to
+the input file descriptor for the GnuPG process.
+Each string should be given exactly as it would be on
+the commandline interface to GnuPG,
+e.g. [&#8220;&#8211;cipher-algo AES256&#8221;, &#8220;&#8211;default-key
+A3ADB67A2CDB8B35&#8221;].</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, the passphrase will be sent to the
+stdin file descriptor for the attached GnuPG
+process.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._open_subprocess">
+<tt class="descname">_open_subprocess</tt><big>(</big><em>args=None</em>, <em>passphrase=False</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._open_subprocess"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._open_subprocess" title="Permalink to this definition">¶</a></dt>
+<dd><p>Open a pipe to a GPG subprocess and return the file objects for
+communicating with it.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>args</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; A list of strings of options and flags to pass to
+<tt class="docutils literal"><span class="pre">GPG.binary</span></tt>. This is input safe, meaning that
+these values go through strict checks (see
+<tt class="docutils literal"><span class="pre">parsers._sanitise_list</span></tt>) before being passed to to
+the input file descriptor for the GnuPG process.
+Each string should be given exactly as it would be on
+the commandline interface to GnuPG,
+e.g. [&#8220;&#8211;cipher-algo AES256&#8221;, &#8220;&#8211;default-key
+A3ADB67A2CDB8B35&#8221;].</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, the passphrase will be sent to the
+stdin file descriptor for the attached GnuPG
+process.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._read_response">
+<tt class="descname">_read_response</tt><big>(</big><em>stream</em>, <em>result</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._read_response"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._read_response" title="Permalink to this definition">¶</a></dt>
+<dd><p>Reads all the stderr output from GPG, taking notice only of lines
+that begin with the magic [GNUPG:] prefix.</p>
+<p>Calls methods on the response object for each valid token found, with
+the arg being the remainder of the status line.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>stream</strong> &#8211; A byte-stream, file handle, or a
+<a class="reference external" href="http://docs.python.org/library/subprocess.html#subprocess.PIPE" title="(in Python v2.7)"><tt class="xref py py-data docutils literal"><span class="pre">subprocess.PIPE</span></tt></a> for parsing the status codes
+from the GnuPG process.</li>
+<li><strong>result</strong> &#8211; The result parser class from <a class="reference internal" href="#module-gnupg._parsers" title="gnupg._parsers"><tt class="xref py py-mod docutils literal"><span class="pre">_parsers</span></tt></a> ―
+the <tt class="docutils literal"><span class="pre">handle_status()</span></tt> method of that class will be
+called in order to parse the output of <tt class="docutils literal"><span class="pre">stream</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._read_data">
+<tt class="descname">_read_data</tt><big>(</big><em>stream</em>, <em>result</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._read_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._read_data" title="Permalink to this definition">¶</a></dt>
+<dd><p>Incrementally read from <tt class="docutils literal"><span class="pre">stream</span></tt> and store read data.</p>
+<p>All data gathered from calling <tt class="docutils literal"><span class="pre">stream.read()</span></tt> will be concatenated
+and stored as <tt class="docutils literal"><span class="pre">result.data</span></tt>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>stream</strong> &#8211; An open file-like object to read() from.</li>
+<li><strong>result</strong> &#8211; An instance of one of the <a class="reference internal" href="#parsers"><em>result parsing classes</em></a> from <tt class="xref py py-const docutils literal"><span class="pre">_result_map</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._collect_output">
+<tt class="descname">_collect_output</tt><big>(</big><em>process</em>, <em>result</em>, <em>writer=None</em>, <em>stdin=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._collect_output"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._collect_output" title="Permalink to this definition">¶</a></dt>
+<dd><p>Drain the subprocesses output streams, writing the collected output
+to the result. If a writer thread (writing to the subprocess) is given,
+make sure it&#8217;s joined before returning. If a stdin stream is given,
+close it before returning.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._handle_io">
+<tt class="descname">_handle_io</tt><big>(</big><em>args</em>, <em>file</em>, <em>result</em>, <em>passphrase=False</em>, <em>binary=False</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._handle_io"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._handle_io" title="Permalink to this definition">¶</a></dt>
+<dd><p>Handle a call to GPG - pass input data, collect output data.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._recv_keys">
+<tt class="descname">_recv_keys</tt><big>(</big><em>keyids</em>, <em>keyserver=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._recv_keys"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._recv_keys" title="Permalink to this definition">¶</a></dt>
+<dd><p>Import keys from a keyserver.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>keyids</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A space-delimited string containing the keyids to
+request.</li>
+<li><strong>keyserver</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The keyserver to request the <tt class="docutils literal"><span class="pre">keyids</span></tt> from;
+defaults to <cite>gnupg.GPG.keyserver</cite>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._sign_file">
+<tt class="descname">_sign_file</tt><big>(</big><em>file</em>, <em>default_key=None</em>, <em>passphrase=None</em>, <em>clearsign=True</em>, <em>detach=False</em>, <em>binary=False</em>, <em>digest_algo='SHA512'</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._sign_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._sign_file" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create a signature for a file.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>file</strong> &#8211; The file stream (i.e. it&#8217;s already been open()&#8217;d) to sign.</li>
+<li><strong>default_key</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The key to sign with.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The passphrase to pipe to stdin.</li>
+<li><strong>clearsign</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, create a cleartext signature.</li>
+<li><strong>detach</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, create a detached signature.</li>
+<li><strong>binary</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, do not ascii armour the output.</li>
+<li><strong>digest_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The hash digest to use. Again, to see which
+hashes your GnuPG is capable of using, do:
+<tt class="docutils literal"><span class="pre">$</span> <span class="pre">gpg</span> <span class="pre">--with-colons</span> <span class="pre">--list-config</span>
+<span class="pre">digestname</span></tt>. The default, if unspecified, is
+<tt class="docutils literal"><span class="pre">'SHA512'</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._meta.GPGBase._encrypt">
+<tt class="descname">_encrypt</tt><big>(</big><em>data</em>, <em>recipients</em>, <em>default_key=None</em>, <em>passphrase=None</em>, <em>armor=True</em>, <em>encrypt=True</em>, <em>symmetric=False</em>, <em>always_trust=True</em>, <em>output=None</em>, <em>cipher_algo='AES256'</em>, <em>digest_algo='SHA512'</em>, <em>compress_algo='ZLIB'</em><big>)</big><a class="reference internal" href="_modules/gnupg/_meta.html#GPGBase._encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._meta.GPGBase._encrypt" title="Permalink to this definition">¶</a></dt>
+<dd><p>Encrypt the message read from the file-like object <strong>data</strong>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>data</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The file or bytestream to encrypt.</li>
+<li><strong>recipients</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The recipients to encrypt to. Recipients must
+be specified keyID/fingerprint.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">Care should be taken in Python2 to make sure that the
+given fingerprints for <strong>recipients</strong> are in fact strings
+and not unicode objects.</p>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>default_key</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The keyID/fingerprint of the key to use for
+signing. If given, <strong>data</strong> will be encrypted
+<em>and</em> signed.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; If given, and <strong>default_key</strong> is also given,
+use this passphrase to unlock the secret
+portion of the <strong>default_key</strong> to sign the
+encrypted <strong>data</strong>. Otherwise, if
+<strong>default_key</strong> is not given, but <strong>symmetric</strong>
+is <tt class="docutils literal"><span class="pre">True</span></tt>, then use this passphrase as the
+passphrase for symmetric encryption. Signing
+and symmetric encryption should <em>not</em> be
+combined when sending the <strong>data</strong> to other
+recipients, else the passphrase to the secret
+key would be shared with them.</li>
+<li><strong>armor</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, ascii armor the output; otherwise, the
+output will be in binary format. (Default: True)</li>
+<li><strong>encrypt</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, encrypt the <strong>data</strong> using the
+<strong>recipients</strong> public keys. (Default: True)</li>
+<li><strong>symmetric</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, encrypt the <strong>data</strong> to <strong>recipients</strong>
+using a symmetric key. See the <strong>passphrase</strong>
+parameter. Symmetric encryption and public key
+encryption can be used simultaneously, and will
+result in a ciphertext which is decryptable
+with either the symmetric <strong>passphrase</strong> or one
+of the corresponding private keys.</li>
+<li><strong>always_trust</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, ignore trust warnings on
+<strong>recipients</strong> keys. If False, display trust
+warnings. (default: True)</li>
+<li><strong>output</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The output file to write to. If not specified, the
+encrypted output is returned, and thus should be
+stored as an object in Python. For example:</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">shutil</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">gnupg</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">if</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">exists</span><span class="p">(</span><span class="s">&quot;doctests&quot;</span><span class="p">):</span>
+<span class="gp">... </span> <span class="n">shutil</span><span class="o">.</span><span class="n">rmtree</span><span class="p">(</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">gpg</span> <span class="o">=</span> <span class="n">gnupg</span><span class="o">.</span><span class="n">GPG</span><span class="p">(</span><span class="n">homedir</span><span class="o">=</span><span class="s">&quot;doctests&quot;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key_settings</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key_input</span><span class="p">(</span><span class="n">key_type</span><span class="o">=</span><span class="s">&#39;RSA&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="n">key_length</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span>
+<span class="gp">... </span> <span class="n">key_usage</span><span class="o">=</span><span class="s">&#39;ESCA&#39;</span><span class="p">,</span>
+<span class="gp">... </span> <span class="n">passphrase</span><span class="o">=</span><span class="s">&#39;foo&#39;</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">key</span> <span class="o">=</span> <span class="n">gpg</span><span class="o">.</span><span class="n">gen_key</span><span class="p">(</span><span class="n">key_settings</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">message</span> <span class="o">=</span> <span class="s">&quot;The crow flies at midnight.&quot;</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">encrypted</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">encrypt</span><span class="p">(</span><span class="n">message</span><span class="p">,</span> <span class="n">key</span><span class="o">.</span><span class="n">printprint</span><span class="p">))</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="n">encrypted</span> <span class="o">!=</span> <span class="n">message</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">encrypted</span><span class="o">.</span><span class="n">isspace</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">decrypted</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">gpg</span><span class="o">.</span><span class="n">decrypt</span><span class="p">(</span><span class="n">encrypted</span><span class="p">))</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">assert</span> <span class="ow">not</span> <span class="n">decrypted</span><span class="o">.</span><span class="n">isspace</span><span class="p">()</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">decrypted</span>
+<span class="go">&#39;The crow flies at midnight.&#39;</span>
+</pre></div>
+</div>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>cipher_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The cipher algorithm to use. To see available
+algorithms with your version of GnuPG, do:
+<strong class="command">$ gpg &#8211;with-colons &#8211;list-config
+ciphername</strong>. The default <strong>cipher_algo</strong>, if
+unspecified, is <tt class="docutils literal"><span class="pre">'AES256'</span></tt>.</li>
+<li><strong>digest_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The hash digest to use. Again, to see which
+hashes your GnuPG is capable of using, do:
+<strong class="command">$ gpg &#8211;with-colons &#8211;list-config
+digestname</strong>. The default, if unspecified, is
+<tt class="docutils literal"><span class="pre">'SHA512'</span></tt>.</li>
+<li><strong>compress_algo</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The compression algorithm to use. Can be one
+of <tt class="docutils literal"><span class="pre">'ZLIB'</span></tt>, <tt class="docutils literal"><span class="pre">'BZIP2'</span></tt>, <tt class="docutils literal"><span class="pre">'ZIP'</span></tt>, or
+<tt class="docutils literal"><span class="pre">'Uncompressed'</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+<div class="section" id="parsers-module">
+<span id="parsers"></span><h2>parsers module<a class="headerlink" href="#parsers-module" title="Permalink to this headline">¶</a></h2>
+<p>These are classes for parsing both user inputs and status file descriptor
+flags from GnuPG&#8217;s output. The latter are used in order to determine what our
+GnuPG process is doing and retrieve information about its operations, which
+are stored in corresponding classes in
+<tt class="xref py py-attr docutils literal"><span class="pre">_result_map</span></tt>. Some status flags aren&#8217;t handled yet
+&#8211; information on <em>all</em> of the flags (well, at least the documented ones…) can
+be found in the <tt class="file docutils literal"><span class="pre">docs/DETAILS</span></tt> file in GnuPG&#8217;s <a class="reference external" href="http://http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=shortlog;h=refs/heads/master">source</a>, which has been
+included <a class="reference external" href="./_static/DETAILS.html">here</a> as well.</p>
+<span class="target" id="module-gnupg._parsers"></span><p>Classes for parsing GnuPG status messages and sanitising commandline
+options.</p>
+<dl class="exception">
+<dt id="gnupg._parsers.ProtectedOption">
+<em class="property">exception </em><tt class="descname">ProtectedOption</tt><a class="reference internal" href="_modules/gnupg/_parsers.html#ProtectedOption"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ProtectedOption" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.Exception" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></a></p>
+<p>Raised when the option passed to GPG is disallowed.</p>
+</dd></dl>
+
+<dl class="exception">
+<dt id="gnupg._parsers.UsageError">
+<em class="property">exception </em><tt class="descname">UsageError</tt><a class="reference internal" href="_modules/gnupg/_parsers.html#UsageError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.UsageError" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.Exception" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></a></p>
+<p>Raised when incorrect usage of the API occurs..</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._check_keyserver">
+<tt class="descname">_check_keyserver</tt><big>(</big><em>location</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_check_keyserver"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._check_keyserver" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check that a given keyserver is a known protocol and does not contain
+shell escape characters.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>location</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A string containing the default keyserver. This
+should contain the desired keyserver protocol which
+is supported by the keyserver, for example, the
+default is <tt class="docutils literal"><span class="pre">'hkp://wwwkeys</span> <span class="pre">.pgp.net'</span></tt>.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/constants.html#None" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt></a></td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A string specifying the protocol and keyserver hostname, if the
+checks passed. If not, returns None.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._check_preferences">
+<tt class="descname">_check_preferences</tt><big>(</big><em>prefs</em>, <em>pref_type=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_check_preferences"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._check_preferences" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check cipher, digest, and compression preference settings.</p>
+<p>MD5 is not allowed. This is <a class="reference external" href="http://www.cs.colorado.edu/~jrblack/papers/md5e-full.pdf">not 1994</a>. SHA1 is <a class="reference external" href="http://eprint.iacr.org/2008/469.pdf">allowed</a> <a class="reference external" href="https://www.schneier.com/blog/archives/2012/10/when_will_we_se.html">grudgingly</a>.</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._fix_unsafe">
+<tt class="descname">_fix_unsafe</tt><big>(</big><em>shell_input</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_fix_unsafe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._fix_unsafe" title="Permalink to this definition">¶</a></dt>
+<dd><p>Find characters used to escape from a string into a shell, and wrap them in
+quotes if they exist. Regex pilfered from Python3 <a class="reference external" href="http://docs.python.org/library/shlex.html#module-shlex" title="(in Python v2.7)"><tt class="xref py py-mod docutils literal"><span class="pre">shlex</span></tt></a> module.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>shell_input</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The input intended for the GnuPG process.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._hyphenate">
+<tt class="descname">_hyphenate</tt><big>(</big><em>input</em>, <em>add_prefix=False</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_hyphenate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._hyphenate" title="Permalink to this definition">¶</a></dt>
+<dd><p>Change underscores to hyphens so that object attributes can be easily
+tranlated to GPG option names.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>input</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The attribute to hyphenate.</li>
+<li><strong>add_prefix</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, add leading hyphens to the input.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">str</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The <tt class="docutils literal"><span class="pre">input</span></tt> with underscores changed to hyphens.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._is_allowed">
+<tt class="descname">_is_allowed</tt><big>(</big><em>input</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_is_allowed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._is_allowed" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check that an option or argument given to GPG is in the set of allowed
+options, the latter being a strict subset of the set of all options known
+to GPG.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>input</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; An input meant to be parsed as an option or flag to the
+GnuPG process. Should be formatted the same as an option
+or flag to the commandline gpg, i.e. &#8220;&#8211;encrypt-files&#8221;.</p>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first simple">
+<li><strong>gnupg_options</strong> (<a class="reference external" href="http://docs.python.org/library/stdtypes.html#frozenset" title="(in Python v2.7)"><em>frozenset</em></a>) &#8211; All known GPG options and flags.</li>
+<li><strong>allowed</strong> (<a class="reference external" href="http://docs.python.org/library/stdtypes.html#frozenset" title="(in Python v2.7)"><em>frozenset</em></a>) &#8211; All allowed GPG options and flags, e.g. all GPG
+options and flags which we are willing to
+acknowledge and parse. If we want to support a
+new option, it will need to have its own parsing
+class and its name will need to be added to this
+set.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><a class="reference internal" href="#gnupg._parsers.UsageError" title="gnupg._parsers.UsageError"><tt class="xref py py-exc docutils literal"><span class="pre">UsageError</span></tt></a> if <strong>input</strong> is not a subset of the hard-coded
+set of all GnuPG options in <a class="reference internal" href="#gnupg._parsers._get_all_gnupg_options" title="gnupg._parsers._get_all_gnupg_options"><tt class="xref py py-func docutils literal"><span class="pre">_get_all_gnupg_options()</span></tt></a>.</p>
+<p><a class="reference internal" href="#gnupg._parsers.ProtectedOption" title="gnupg._parsers.ProtectedOption"><tt class="xref py py-exc docutils literal"><span class="pre">ProtectedOption</span></tt></a> if <strong>input</strong> is not in the set of allowed
+options.</p>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">str</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The original <strong>input</strong> parameter, unmodified and unsanitized, if
+no errors occur.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._is_hex">
+<tt class="descname">_is_hex</tt><big>(</big><em>string</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_is_hex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._is_hex" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check that a string is hexidecimal, with alphabetic characters
+capitalized and without whitespace.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>string</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The string to check.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._is_string">
+<tt class="descname">_is_string</tt><big>(</big><em>thing</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_is_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._is_string" title="Permalink to this definition">¶</a></dt>
+<dd><p>Python character arrays are a mess.</p>
+<p>If Python2, check if <strong>thing</strong> is an <a class="reference external" href="http://docs.python.org/library/functions.html#unicode" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">unicode</span></tt></a> or a <a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>.
+If Python3, check if <strong>thing</strong> is a <a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><tt class="xref py py-obj docutils literal"><span class="pre">str</span></tt></a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>thing</strong> &#8211; The thing to check.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">True</span></tt> if <strong>thing</strong> is a string according to whichever version
+of Python we&#8217;re running in.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._sanitise">
+<tt class="descname">_sanitise</tt><big>(</big><em>*args</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_sanitise"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._sanitise" title="Permalink to this definition">¶</a></dt>
+<dd><p>Take an arg or the key portion of a kwarg and check that it is in the
+set of allowed GPG options and flags, and that it has the correct
+type. Then, attempt to escape any unsafe characters. If an option is not
+allowed, drop it with a logged warning. Returns a dictionary of all
+sanitised, allowed options.</p>
+<p>Each new option that we support that is not a boolean, but instead has
+some additional inputs following it, i.e. &#8220;&#8211;encrypt-file foo.txt&#8221;, will
+need some basic safety checks added here.</p>
+<p>GnuPG has three-hundred and eighteen commandline flags. Also, not all
+implementations of OpenPGP parse PGP packets and headers in the same way,
+so there is added potential there for messing with calls to GPG.</p>
+<p>For information on the PGP message format specification, see
+<span class="target" id="index-0"></span><a class="rfc reference external" href="http://tools.ietf.org/html/rfc1991.html"><strong>RFC 1991</strong></a>.</p>
+<p>If you&#8217;re asking, &#8220;Is this <em>really</em> necessary?&#8221;: No, not really &#8211; we could
+just follow the security precautions recommended by <a class="reference external" href="https://xkcd.com/1181/">this xkcd</a>.</p>
+<blockquote>
+<div></div></blockquote>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>args</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; (optional) The boolean arguments which will be passed to
+the GnuPG process.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">str</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">sanitised</span></tt></td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._sanitise_list">
+<tt class="descname">_sanitise_list</tt><big>(</big><em>arg_list</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_sanitise_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._sanitise_list" title="Permalink to this definition">¶</a></dt>
+<dd><p>A generator for iterating through a list of gpg options and sanitising
+them.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>arg_list</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#list" title="(in Python v2.7)"><em>list</em></a>) &#8211; A list of options and flags for GnuPG.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">generator</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A generator whose next() method returns each of the items in
+<tt class="docutils literal"><span class="pre">arg_list</span></tt> after calling <tt class="docutils literal"><span class="pre">_sanitise()</span></tt> with that item as a
+parameter.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._get_options_group">
+<tt class="descname">_get_options_group</tt><big>(</big><em>group=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_get_options_group"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._get_options_group" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get a specific group of options which are allowed.</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers._get_all_gnupg_options">
+<tt class="descname">_get_all_gnupg_options</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#_get_all_gnupg_options"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers._get_all_gnupg_options" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get all GnuPG options and flags.</p>
+<p>This is hardcoded within a local scope to reduce the chance of a tampered
+GnuPG binary reporting falsified option sets, i.e. because certain options
+(namedly the <tt class="docutils literal"><span class="pre">--no-options</span></tt> option, which prevents the usage of gpg.conf
+files) are necessary and statically specified in
+<a class="reference internal" href="#gnupg._meta.GPGBase._make_args" title="gnupg._meta.GPGBase._make_args"><tt class="xref py py-meth docutils literal"><span class="pre">gnupg._meta.GPGBase._make_args()</span></tt></a>, if the inputs into Python are
+already controlled, and we were to summon the GnuPG binary to ask it for
+its options, it would be possible to receive a falsified options set
+missing the <tt class="docutils literal"><span class="pre">--no-options</span></tt> option in response. This seems unlikely, and
+the method is stupid and ugly, but at least we&#8217;ll never have to debug
+whether or not an option <em>actually</em> disappeared in a different GnuPG
+version, or some funny business is happening.</p>
+<p>These are the options as of GnuPG 1.4.12; the current stable branch of the
+2.1.x tree contains a few more &#8211; if you need them you&#8217;ll have to add them
+in here.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><strong>gnupg_options</strong> &#8211; All known GPG options and flags.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">frozenset</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><tt class="docutils literal"><span class="pre">gnupg_options</span></tt></td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers.nodata">
+<tt class="descname">nodata</tt><big>(</big><em>status_code</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#nodata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.nodata" title="Permalink to this definition">¶</a></dt>
+<dd><p>Translate NODATA status codes from GnuPG to messages.</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._parsers.progress">
+<tt class="descname">progress</tt><big>(</big><em>status_code</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#progress"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.progress" title="Permalink to this definition">¶</a></dt>
+<dd><p>Translate PROGRESS status codes from GnuPG to messages.</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.GenKey">
+<em class="property">class </em><tt class="descname">GenKey</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#GenKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.GenKey" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Handle status messages for key generation.</p>
+<p>Calling the <tt class="docutils literal"><span class="pre">__str__()</span></tt> method of this class will return the generated
+key&#8217;s fingerprint, or a status string explaining the results.</p>
+<dl class="attribute">
+<dt id="gnupg._parsers.GenKey.type">
+<tt class="descname">type</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.GenKey.type" title="Permalink to this definition">¶</a></dt>
+<dd><p>&#8216;P&#8217;:= primary, &#8216;S&#8217;:= subkey, &#8216;B&#8217;:= both</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.GenKey.keyring">
+<tt class="descname">keyring</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.GenKey.keyring" title="Permalink to this definition">¶</a></dt>
+<dd><p>This will store the key&#8217;s public keyring filename, if
+<a class="reference internal" href="#gnupg.GPG.gen_key_input" title="gnupg.GPG.gen_key_input"><tt class="xref py py-meth docutils literal"><span class="pre">gen_key_input()</span></tt></a> was called with
+<tt class="docutils literal"><span class="pre">separate_keyring=True</span></tt>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.GenKey.secring">
+<tt class="descname">secring</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.GenKey.secring" title="Permalink to this definition">¶</a></dt>
+<dd><p>This will store the key&#8217;s secret keyring filename, if :
+<a class="reference internal" href="#gnupg.GPG.gen_key_input" title="gnupg.GPG.gen_key_input"><tt class="xref py py-meth docutils literal"><span class="pre">gen_key_input()</span></tt></a> was called with
+<tt class="docutils literal"><span class="pre">separate_keyring=True</span></tt>.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.GenKey._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#GenKey._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.GenKey._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.DeleteResult">
+<em class="property">class </em><tt class="descname">DeleteResult</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#DeleteResult"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.DeleteResult" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Handle status messages for &#8211;delete-keys and &#8211;delete-secret-keys</p>
+<dl class="attribute">
+<dt id="gnupg._parsers.DeleteResult.problem_reason">
+<tt class="descname">problem_reason</tt><em class="property"> = {'1': 'No such key', '3': 'Ambigious specification', '2': 'Must delete secret key first'}</em><a class="headerlink" href="#gnupg._parsers.DeleteResult.problem_reason" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.DeleteResult._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#DeleteResult._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.DeleteResult._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.Sign">
+<em class="property">class </em><tt class="descname">Sign</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#Sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.Sign" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Parse GnuPG status messages for signing operations.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>gpg</strong> &#8211; An instance of <a class="reference internal" href="#gnupg.GPG" title="gnupg.GPG"><tt class="xref py py-class docutils literal"><span class="pre">gnupg.GPG</span></tt></a>.</td>
+</tr>
+</tbody>
+</table>
+<dl class="attribute">
+<dt id="gnupg._parsers.Sign.sig_type">
+<tt class="descname">sig_type</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Sign.sig_type" title="Permalink to this definition">¶</a></dt>
+<dd><p>The type of signature created.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Sign.sig_algo">
+<tt class="descname">sig_algo</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Sign.sig_algo" title="Permalink to this definition">¶</a></dt>
+<dd><p>The algorithm used to create the signature.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Sign.sig_hash_also">
+<tt class="descname">sig_hash_also</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Sign.sig_hash_also" title="Permalink to this definition">¶</a></dt>
+<dd><p>The hash algorithm used to create the signature.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Sign.fingerprint">
+<tt class="descname">fingerprint</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Sign.fingerprint" title="Permalink to this definition">¶</a></dt>
+<dd><p>The fingerprint of the signing keyid.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Sign.timestamp">
+<tt class="descname">timestamp</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Sign.timestamp" title="Permalink to this definition">¶</a></dt>
+<dd><p>The timestamp on the signature.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Sign.what">
+<tt class="descname">what</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Sign.what" title="Permalink to this definition">¶</a></dt>
+<dd><p>xxx fill me in</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.Sign._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#Sign._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.Sign._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.ListKeys">
+<em class="property">class </em><tt class="descname">ListKeys</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListKeys"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListKeys" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">list</span></tt></p>
+<p>Handle status messages for &#8211;list-keys.</p>
+<p>Handles pub and uid (relating the latter to the former). Don&#8217;t care about
+the following attributes/status messages (from doc/DETAILS):</p>
+<div class="line-block">
+<div class="line">crt = X.509 certificate</div>
+<div class="line">crs = X.509 certificate and private key available</div>
+<div class="line">ssb = secret subkey (secondary key)</div>
+<div class="line">uat = user attribute (same as user id except for field 10).</div>
+<div class="line">sig = signature</div>
+<div class="line">rev = revocation signature</div>
+<div class="line">pkd = public key data (special field format, see below)</div>
+<div class="line">grp = reserved for gpgsm</div>
+<div class="line">rvk = revocation key</div>
+</div>
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys.key">
+<tt class="descname">key</tt><big>(</big><em>args</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListKeys.key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListKeys.key" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys.pub">
+<tt class="descname">pub</tt><big>(</big><em>args</em><big>)</big><a class="headerlink" href="#gnupg._parsers.ListKeys.pub" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys.sec">
+<tt class="descname">sec</tt><big>(</big><em>args</em><big>)</big><a class="headerlink" href="#gnupg._parsers.ListKeys.sec" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys.fpr">
+<tt class="descname">fpr</tt><big>(</big><em>args</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListKeys.fpr"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListKeys.fpr" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys.uid">
+<tt class="descname">uid</tt><big>(</big><em>args</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListKeys.uid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListKeys.uid" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys.sub">
+<tt class="descname">sub</tt><big>(</big><em>args</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListKeys.sub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListKeys.sub" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListKeys._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListKeys._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListKeys._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.ImportResult">
+<em class="property">class </em><tt class="descname">ImportResult</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ImportResult"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ImportResult" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Parse GnuPG status messages for key import operations.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>gpg</strong> (<a class="reference internal" href="#gnupg.GPG" title="gnupg.GPG"><tt class="xref py py-class docutils literal"><span class="pre">gnupg.GPG</span></tt></a>) &#8211; An instance of <a class="reference internal" href="#gnupg.GPG" title="gnupg.GPG"><tt class="xref py py-class docutils literal"><span class="pre">gnupg.GPG</span></tt></a>.</td>
+</tr>
+</tbody>
+</table>
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult._ok_reason">
+<tt class="descname">_ok_reason</tt><em class="property"> = {'17': 'Contains private key', '16': 'Contains private key', '1': 'Entirely new key', '0': 'Not actually changed', '2': 'New user IDs', '4': 'New signatures', '8': 'New subkeys'}</em><a class="headerlink" href="#gnupg._parsers.ImportResult._ok_reason" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult._problem_reason">
+<tt class="descname">_problem_reason</tt><em class="property"> = {'1': 'Invalid Certificate', '0': 'No specific reason given', '3': 'Certificate Chain too long', '2': 'Issuer Certificate missing', '4': 'Error storing certificate'}</em><a class="headerlink" href="#gnupg._parsers.ImportResult._problem_reason" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult._fields">
+<tt class="descname">_fields</tt><em class="property"> = ['count', 'no_user_id', 'imported', 'imported_rsa', 'unchanged', 'n_uids', 'n_subk', 'n_sigs', 'n_revoc', 'sec_read', 'sec_imported', 'sec_dups', 'not_imported']</em><a class="headerlink" href="#gnupg._parsers.ImportResult._fields" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult._counts">
+<tt class="descname">_counts</tt><em class="property"> = OrderedDict([('count', 0), ('no_user_id', 0), ('imported', 0), ('imported_rsa', 0), ('unchanged', 0), ('n_uids', 0), ('n_subk', 0), ('n_sigs', 0), ('n_revoc', 0), ('sec_read', 0), ('sec_imported', 0), ('sec_dups', 0), ('not_imported', 0)])</em><a class="headerlink" href="#gnupg._parsers.ImportResult._counts" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult.fingerprints">
+<tt class="descname">fingerprints</tt><em class="property"> = []</em><a class="headerlink" href="#gnupg._parsers.ImportResult.fingerprints" title="Permalink to this definition">¶</a></dt>
+<dd><p>A list of strings containing the fingerprints of the GnuPG keyIDs
+imported.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult.results">
+<tt class="descname">results</tt><em class="property"> = []</em><a class="headerlink" href="#gnupg._parsers.ImportResult.results" title="Permalink to this definition">¶</a></dt>
+<dd><p>A list containing dictionaries with information gathered on keys
+imported.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ImportResult._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ImportResult._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ImportResult._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ImportResult.summary">
+<tt class="descname">summary</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ImportResult.summary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ImportResult.summary" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ImportResult.x">
+<tt class="descname">x</tt><em class="property"> = 12</em><a class="headerlink" href="#gnupg._parsers.ImportResult.x" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.Verify">
+<em class="property">class </em><tt class="descname">Verify</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#Verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.Verify" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Parser for status messages from GnuPG for certifications and signature
+verifications.</p>
+<p>People often mix these up, or think that they are the same thing. While it
+is true that certifications and signatures <em>are</em> the same cryptographic
+operation &#8211; and also true that both are the same as the decryption
+operation &#8211; a distinction is made for important reasons.</p>
+<dl class="docutils">
+<dt>A certification:</dt>
+<dd><ul class="first last simple">
+<li>is made on a key,</li>
+<li>can help to validate or invalidate the key owner&#8217;s identity,</li>
+<li>can assign trust levels to the key (or to uids and/or subkeys that
+the key contains),</li>
+<li>and can be used in absense of in-person fingerprint checking to try
+to build a path (through keys whose fingerprints have been checked)
+to the key, so that the identity of the key&#8217;s owner can be more
+reliable without having to actually physically meet in person.</li>
+</ul>
+</dd>
+<dt>A signature:</dt>
+<dd><ul class="first last simple">
+<li>is created for a file or other piece of data,</li>
+<li>can help to prove that the data hasn&#8217;t been altered,</li>
+<li>and can help to prove that the data was sent by the person(s) in
+possession of the private key that created the signature, and for
+parsing portions of status messages from decryption operations.</li>
+</ul>
+</dd>
+</dl>
+<p>There are probably other things unique to each that have been
+scatterbrainedly omitted due to the programmer sitting still and staring
+at GnuPG debugging logs for too long without snacks, but that is the gist
+of it.</p>
+<p>Create a parser for verification and certification commands.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>gpg</strong> &#8211; An instance of <a class="reference internal" href="#gnupg.GPG" title="gnupg.GPG"><tt class="xref py py-class docutils literal"><span class="pre">gnupg.GPG</span></tt></a>.</td>
+</tr>
+</tbody>
+</table>
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.TRUST_UNDEFINED">
+<tt class="descname">TRUST_UNDEFINED</tt><em class="property"> = 0</em><a class="headerlink" href="#gnupg._parsers.Verify.TRUST_UNDEFINED" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.TRUST_NEVER">
+<tt class="descname">TRUST_NEVER</tt><em class="property"> = 1</em><a class="headerlink" href="#gnupg._parsers.Verify.TRUST_NEVER" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.TRUST_MARGINAL">
+<tt class="descname">TRUST_MARGINAL</tt><em class="property"> = 2</em><a class="headerlink" href="#gnupg._parsers.Verify.TRUST_MARGINAL" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.TRUST_FULLY">
+<tt class="descname">TRUST_FULLY</tt><em class="property"> = 3</em><a class="headerlink" href="#gnupg._parsers.Verify.TRUST_FULLY" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.TRUST_ULTIMATE">
+<tt class="descname">TRUST_ULTIMATE</tt><em class="property"> = 4</em><a class="headerlink" href="#gnupg._parsers.Verify.TRUST_ULTIMATE" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.TRUST_LEVELS">
+<tt class="descname">TRUST_LEVELS</tt><em class="property"> = {'TRUST_UNDEFINED': 0, 'TRUST_FULLY': 3, 'TRUST_NEVER': 1, 'TRUST_MARGINAL': 2, 'TRUST_ULTIMATE': 4}</em><a class="headerlink" href="#gnupg._parsers.Verify.TRUST_LEVELS" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.valid">
+<tt class="descname">valid</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.valid" title="Permalink to this definition">¶</a></dt>
+<dd><p>True if the signature is valid, False otherwise.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.status">
+<tt class="descname">status</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.status" title="Permalink to this definition">¶</a></dt>
+<dd><p>A string describing the status of the signature verification.
+Can be one of <tt class="docutils literal"><span class="pre">signature</span> <span class="pre">bad</span></tt>, <tt class="docutils literal"><span class="pre">signature</span> <span class="pre">good</span></tt>,
+<tt class="docutils literal"><span class="pre">signature</span> <span class="pre">valid</span></tt>, <tt class="docutils literal"><span class="pre">signature</span> <span class="pre">error</span></tt>, <tt class="docutils literal"><span class="pre">decryption</span> <span class="pre">failed</span></tt>,
+<tt class="docutils literal"><span class="pre">no</span> <span class="pre">public</span> <span class="pre">key</span></tt>, <tt class="docutils literal"><span class="pre">key</span> <span class="pre">exp</span></tt>, or <tt class="docutils literal"><span class="pre">key</span> <span class="pre">rev</span></tt>.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.fingerprint">
+<tt class="descname">fingerprint</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.fingerprint" title="Permalink to this definition">¶</a></dt>
+<dd><p>The fingerprint of the signing keyid.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.pubkey_fingerprint">
+<tt class="descname">pubkey_fingerprint</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.pubkey_fingerprint" title="Permalink to this definition">¶</a></dt>
+<dd><p>The fingerprint of the corresponding public key, which may be
+different if the signature was created with a subkey.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.key_id">
+<tt class="descname">key_id</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.key_id" title="Permalink to this definition">¶</a></dt>
+<dd><p>The keyid of the signing key.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.signature_id">
+<tt class="descname">signature_id</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.signature_id" title="Permalink to this definition">¶</a></dt>
+<dd><p>The id of the signature itself.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.creation_date">
+<tt class="descname">creation_date</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.creation_date" title="Permalink to this definition">¶</a></dt>
+<dd><p>The creation date of the signing key.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.timestamp">
+<tt class="descname">timestamp</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.timestamp" title="Permalink to this definition">¶</a></dt>
+<dd><p>The timestamp of the purported signature, if we are unable to parse
+and/or validate it.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.sig_timestamp">
+<tt class="descname">sig_timestamp</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.sig_timestamp" title="Permalink to this definition">¶</a></dt>
+<dd><p>The timestamp for when the valid signature was created.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.username">
+<tt class="descname">username</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.username" title="Permalink to this definition">¶</a></dt>
+<dd><p>The userid of the signing key which was used to create the
+signature.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.expire_timestamp">
+<tt class="descname">expire_timestamp</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.expire_timestamp" title="Permalink to this definition">¶</a></dt>
+<dd><p>When the signing key is due to expire.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.trust_level">
+<tt class="descname">trust_level</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.trust_level" title="Permalink to this definition">¶</a></dt>
+<dd><p>An integer 0-4 describing the trust level of the signature.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Verify.trust_text">
+<tt class="descname">trust_text</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Verify.trust_text" title="Permalink to this definition">¶</a></dt>
+<dd><p>The string corresponding to the <tt class="docutils literal"><span class="pre">trust_level</span></tt> number.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.Verify._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#Verify._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.Verify._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.Crypt">
+<em class="property">class </em><tt class="descname">Crypt</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#Crypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.Crypt" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <a class="reference internal" href="#gnupg._parsers.Verify" title="gnupg._parsers.Verify"><tt class="xref py py-class docutils literal"><span class="pre">gnupg._parsers.Verify</span></tt></a></p>
+<p>Parser for internal status messages from GnuPG for <tt class="docutils literal"><span class="pre">--encrypt</span></tt>,
+<tt class="docutils literal"><span class="pre">--decrypt</span></tt>, and <tt class="docutils literal"><span class="pre">--decrypt-files</span></tt>.</p>
+<dl class="attribute">
+<dt id="gnupg._parsers.Crypt.data">
+<tt class="descname">data</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Crypt.data" title="Permalink to this definition">¶</a></dt>
+<dd><p>A string containing the encrypted or decrypted data.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Crypt.ok">
+<tt class="descname">ok</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Crypt.ok" title="Permalink to this definition">¶</a></dt>
+<dd><p>True if the decryption/encryption process turned out okay.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.Crypt.status">
+<tt class="descname">status</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.Crypt.status" title="Permalink to this definition">¶</a></dt>
+<dd><p>A string describing the current processing status, or error, if one
+has occurred.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.Crypt._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#Crypt._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.Crypt._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._parsers.ListPackets">
+<em class="property">class </em><tt class="descname">ListPackets</tt><big>(</big><em>gpg</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListPackets"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListPackets" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Handle status messages for &#8211;list-packets.</p>
+<dl class="attribute">
+<dt id="gnupg._parsers.ListPackets.status">
+<tt class="descname">status</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.ListPackets.status" title="Permalink to this definition">¶</a></dt>
+<dd><p>A string describing the current processing status, or error, if one
+has occurred.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ListPackets.need_passphrase">
+<tt class="descname">need_passphrase</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.ListPackets.need_passphrase" title="Permalink to this definition">¶</a></dt>
+<dd><p>True if the passphrase to a public/private keypair is required.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ListPackets.need_passphrase_sym">
+<tt class="descname">need_passphrase_sym</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.ListPackets.need_passphrase_sym" title="Permalink to this definition">¶</a></dt>
+<dd><p>True if a passphrase for a symmetric key is required.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="gnupg._parsers.ListPackets.userid_hint">
+<tt class="descname">userid_hint</tt><em class="property"> = None</em><a class="headerlink" href="#gnupg._parsers.ListPackets.userid_hint" title="Permalink to this definition">¶</a></dt>
+<dd><p>The keyid and uid which this data is encrypted to.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="gnupg._parsers.ListPackets._handle_status">
+<tt class="descname">_handle_status</tt><big>(</big><em>key</em>, <em>value</em><big>)</big><a class="reference internal" href="_modules/gnupg/_parsers.html#ListPackets._handle_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._parsers.ListPackets._handle_status" title="Permalink to this definition">¶</a></dt>
+<dd><p>Parse a status code from the attached GnuPG process.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.ValueError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">ValueError</span></tt></a> if the status message is unknown.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+<div class="section" id="util-module">
+<span id="util"></span><h2>util module<a class="headerlink" href="#util-module" title="Permalink to this headline">¶</a></h2>
+<p>You shouldn&#8217;t really need to mess with this module either, it mostly deals
+with low-level IO and file handling operations, de-/en- coding issues, and
+setting up basic package facilities such as logging.</p>
+<span class="target" id="module-gnupg._util"></span><p>Extra utilities for python-gnupg.</p>
+<dl class="function">
+<dt id="gnupg._util.find_encodings">
+<tt class="descname">find_encodings</tt><big>(</big><em>enc=None</em>, <em>system=False</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#find_encodings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util.find_encodings" title="Permalink to this definition">¶</a></dt>
+<dd><p>Find functions for encoding translations for a specific codec.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>enc</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The codec to find translation functions for. It will be
+normalized by converting to lowercase, excluding
+everything which is not ascii, and hyphens will be
+converted to underscores.</li>
+<li><strong>system</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#bool" title="(in Python v2.7)"><em>bool</em></a>) &#8211; If True, find encodings based on the system&#8217;s stdin
+encoding, otherwise assume utf-8.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">:exc:LookupError if the normalized codec, <tt class="docutils literal"><span class="pre">enc</span></tt>, cannot be
+found in Python&#8217;s encoding translation map.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util.author_info">
+<tt class="descname">author_info</tt><big>(</big><em>name</em>, <em>contact=None</em>, <em>public_key=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#author_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util.author_info" title="Permalink to this definition">¶</a></dt>
+<dd><p>Easy object-oriented representation of contributor info.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>name</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The contributor´s name.</li>
+<li><strong>contact</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The contributor´s email address or contact
+information, if given.</li>
+<li><strong>public_key</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The contributor´s public keyid, if given.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._copy_data">
+<tt class="descname">_copy_data</tt><big>(</big><em>instream</em>, <em>outstream</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_copy_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._copy_data" title="Permalink to this definition">¶</a></dt>
+<dd><p>Copy data from one stream to another.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>instream</strong> (<a class="reference external" href="http://docs.python.org/library/io.html#io.BytesIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">io.BytesIO</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/io.html#io.StringIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">io.StringIO</span></tt></a> or file) &#8211; A byte stream or open file to read from.</li>
+<li><strong>outstream</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#file" title="(in Python v2.7)"><em>file</em></a>) &#8211; The file descriptor of a tmpfile to write to.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._create_if_necessary">
+<tt class="descname">_create_if_necessary</tt><big>(</big><em>directory</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_create_if_necessary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._create_if_necessary" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create the specified directory, if necessary.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>directory</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The directory to use.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if no errors occurred and the directory was created or
+existed beforehand, False otherwise.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util.create_uid_email">
+<tt class="descname">create_uid_email</tt><big>(</big><em>username=None</em>, <em>hostname=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#create_uid_email"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util.create_uid_email" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create an email address suitable for a UID on a GnuPG key.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>username</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The username portion of an email address. If None,
+defaults to the username of the running Python
+process.</li>
+<li><strong>hostname</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The FQDN portion of an email address. If None, the
+hostname is obtained from gethostname(2).</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">str</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A string formatted as &lt;username&gt;&#64;&lt;hostname&gt;.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._deprefix">
+<tt class="descname">_deprefix</tt><big>(</big><em>line</em>, <em>prefix</em>, <em>callback=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_deprefix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._deprefix" title="Permalink to this definition">¶</a></dt>
+<dd><p>Remove the prefix string from the beginning of line, if it exists.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>line</strong> (<a class="reference external" href="http://docs.python.org/library/string.html#module-string" title="(in Python v2.7)"><em>string</em></a>) &#8211; A line, such as one output by GnuPG&#8217;s status-fd.</li>
+<li><strong>prefix</strong> (<a class="reference external" href="http://docs.python.org/library/string.html#module-string" title="(in Python v2.7)"><em>string</em></a>) &#8211; A substring to remove from the beginning of
+<tt class="docutils literal"><span class="pre">line</span></tt>. Case insensitive.</li>
+<li><strong>callback</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#callable" title="(in Python v2.7)"><em>callable</em></a>) &#8211; Function to call if the prefix is found. The signature to
+callback will be only one argument, the <tt class="docutils literal"><span class="pre">line</span></tt> without the <tt class="docutils literal"><span class="pre">prefix</span></tt>, i.e.
+<tt class="docutils literal"><span class="pre">callback(line)</span></tt>.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">string</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">If the prefix was found, the <tt class="docutils literal"><span class="pre">line</span></tt> without the prefix is
+returned. Otherwise, the original <tt class="docutils literal"><span class="pre">line</span></tt> is returned.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._find_binary">
+<tt class="descname">_find_binary</tt><big>(</big><em>binary=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_find_binary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._find_binary" title="Permalink to this definition">¶</a></dt>
+<dd><p>Find the absolute path to the GnuPG binary.</p>
+<p>Also run checks that the binary is not a symlink, and check that
+our process real uid has exec permissions.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>binary</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The path to the GnuPG binary.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><a class="reference external" href="http://docs.python.org/library/exceptions.html#exceptions.RuntimeError" title="(in Python v2.7)"><tt class="xref py py-exc docutils literal"><span class="pre">RuntimeError</span></tt></a> if it appears that GnuPG is not
+installed.</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The absolute path to the GnuPG binary to use, if no exceptions
+occur.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._has_readwrite">
+<tt class="descname">_has_readwrite</tt><big>(</big><em>path</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_has_readwrite"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._has_readwrite" title="Permalink to this definition">¶</a></dt>
+<dd><p>Determine if the real uid/gid of the executing user has read and write
+permissions for a directory or a file.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The path to the directory or file to check permissions
+for.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if real uid/gid has read+write permissions, False otherwise.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._is_file">
+<tt class="descname">_is_file</tt><big>(</big><em>filename</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_is_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._is_file" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check that the size of the thing which is supposed to be a filename has
+size greater than zero, without following symbolic links or using
+:func:os.path.isfile.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>filename</strong> &#8211; An object to check.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if <strong>filename</strong> is file-like, False otherwise.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._is_stream">
+<tt class="descname">_is_stream</tt><big>(</big><em>input</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_is_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._is_stream" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check that the input is a byte stream.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>input</strong> &#8211; An object provided for reading from or writing to.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if :param:input is a stream, False if otherwise.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._is_list_or_tuple">
+<tt class="descname">_is_list_or_tuple</tt><big>(</big><em>instance</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_is_list_or_tuple"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._is_list_or_tuple" title="Permalink to this definition">¶</a></dt>
+<dd><p>Check that <tt class="docutils literal"><span class="pre">instance</span></tt> is a list or tuple.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>instance</strong> &#8211; The object to type check.</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True if <tt class="docutils literal"><span class="pre">instance</span></tt> is a list or tuple, False otherwise.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._is_gpg1">
+<tt class="descname">_is_gpg1</tt><big>(</big><em>version</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_is_gpg1"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._is_gpg1" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns True if using GnuPG version 1.x.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>version</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#tuple" title="(in Python v2.7)"><em>tuple</em></a>) &#8211; A tuple of three integers indication major, minor,
+and micro version numbers.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._is_gpg2">
+<tt class="descname">_is_gpg2</tt><big>(</big><em>version</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_is_gpg2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._is_gpg2" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns True if using GnuPG version 2.x.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>version</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#tuple" title="(in Python v2.7)"><em>tuple</em></a>) &#8211; A tuple of three integers indication major, minor,
+and micro version numbers.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._make_binary_stream">
+<tt class="descname">_make_binary_stream</tt><big>(</big><em>s</em>, <em>encoding</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_make_binary_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._make_binary_stream" title="Permalink to this definition">¶</a></dt>
+<dd><p>xxx fill me in</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._make_passphrase">
+<tt class="descname">_make_passphrase</tt><big>(</big><em>length=None</em>, <em>save=False</em>, <em>file=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_make_passphrase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._make_passphrase" title="Permalink to this definition">¶</a></dt>
+<dd><p>Create a passphrase and write it to a file that only the user can read.</p>
+<p>This is not very secure, and should not be relied upon for actual key
+passphrases.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>length</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) &#8211; The length in bytes of the string to generate.</li>
+<li><strong>file</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#file" title="(in Python v2.7)"><em>file</em></a>) &#8211; The file to save the generated passphrase in. If not
+given, defaults to &#8216;passphrase-&lt;the real user id&gt;-&lt;seconds since
+epoch&gt;&#8217; in the top-level directory.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._make_random_string">
+<tt class="descname">_make_random_string</tt><big>(</big><em>length</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_make_random_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._make_random_string" title="Permalink to this definition">¶</a></dt>
+<dd><p>Returns a random lowercase, uppercase, alphanumerical string.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>length</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) &#8211; The length in bytes of the string to generate.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._match_version_string">
+<tt class="descname">_match_version_string</tt><big>(</big><em>version</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_match_version_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._match_version_string" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sort a binary version string into major, minor, and micro integers.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>version</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; A version string in the form x.x.x</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._next_year">
+<tt class="descname">_next_year</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_next_year"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._next_year" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the date of today plus one year.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The date of this day next year, in the format &#8216;%Y-%m-%d&#8217;.</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._now">
+<tt class="descname">_now</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_now"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._now" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get a timestamp for right now, formatted according to ISO 8601.</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._separate_keyword">
+<tt class="descname">_separate_keyword</tt><big>(</big><em>line</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_separate_keyword"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._separate_keyword" title="Permalink to this definition">¶</a></dt>
+<dd><p>Split the line, and return (first_word, the_rest).</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._threaded_copy_data">
+<tt class="descname">_threaded_copy_data</tt><big>(</big><em>instream</em>, <em>outstream</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_threaded_copy_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._threaded_copy_data" title="Permalink to this definition">¶</a></dt>
+<dd><p>Copy data from one stream to another in a separate thread.</p>
+<p>Wraps <tt class="docutils literal"><span class="pre">_copy_data()</span></tt> in a <a class="reference external" href="http://docs.python.org/library/threading.html#threading.Thread" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">threading.Thread</span></tt></a>.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>instream</strong> (<a class="reference external" href="http://docs.python.org/library/io.html#io.BytesIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">io.BytesIO</span></tt></a> or <a class="reference external" href="http://docs.python.org/library/io.html#io.StringIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">io.StringIO</span></tt></a>) &#8211; A byte stream to read from.</li>
+<li><strong>outstream</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#file" title="(in Python v2.7)"><em>file</em></a>) &#8211; The file descriptor of a tmpfile to write to.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._utc_epoch">
+<tt class="descname">_utc_epoch</tt><big>(</big><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_utc_epoch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._utc_epoch" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the seconds since epoch.</p>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._which">
+<tt class="descname">_which</tt><big>(</big><em>executable</em>, <em>flags=1</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_which"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._which" title="Permalink to this definition">¶</a></dt>
+<dd><p>Borrowed from Twisted&#8217;s :mod:twisted.python.proutils .</p>
+<p>Search PATH for executable files with the given name.</p>
+<p>On newer versions of MS-Windows, the PATHEXT environment variable will be
+set to the list of file extensions for files considered executable. This
+will normally include things like &#8221;.EXE&#8221;. This fuction will also find files
+with the given name ending with any of these extensions.</p>
+<p>On MS-Windows the only flag that has any meaning is os.F_OK. Any other
+flags will be ignored.</p>
+<p>Note: This function does not help us prevent an attacker who can already
+manipulate the environment&#8217;s PATH settings from placing malicious code
+higher in the PATH. It also does happily follows links.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
+<li><strong>name</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The name for which to search.</li>
+<li><strong>flags</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#int" title="(in Python v2.7)"><em>int</em></a>) &#8211; Arguments to L{os.access}.</li>
+</ul>
+</td>
+</tr>
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><p class="first">list</p>
+</td>
+</tr>
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of the full paths to files found, in the order in which
+they were found.</p>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="function">
+<dt id="gnupg._util._write_passphrase">
+<tt class="descname">_write_passphrase</tt><big>(</big><em>stream</em>, <em>passphrase</em>, <em>encoding</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#_write_passphrase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util._write_passphrase" title="Permalink to this definition">¶</a></dt>
+<dd><p>Write the passphrase from memory to the GnuPG process&#8217; stdin.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>stream</strong> (file, <a class="reference external" href="http://docs.python.org/library/io.html#io.BytesIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">BytesIO</span></tt></a>, or <a class="reference external" href="http://docs.python.org/library/io.html#io.StringIO" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">StringIO</span></tt></a>) &#8211; The input file descriptor to write the password to.</li>
+<li><strong>passphrase</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The passphrase for the secret key material.</li>
+<li><strong>encoding</strong> (<a class="reference external" href="http://docs.python.org/library/functions.html#str" title="(in Python v2.7)"><em>str</em></a>) &#8211; The data encoding expected by GnuPG. Usually, this
+is <tt class="docutils literal"><span class="pre">sys.getfilesystemencoding()</span></tt>.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._util.InheritableProperty">
+<em class="property">class </em><tt class="descname">InheritableProperty</tt><big>(</big><em>fget=None</em>, <em>fset=None</em>, <em>fdel=None</em>, <em>doc=None</em><big>)</big><a class="reference internal" href="_modules/gnupg/_util.html#InheritableProperty"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util.InheritableProperty" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
+<p>Based on the emulation of PyProperty_Type() in Objects/descrobject.c</p>
+</dd></dl>
+
+<dl class="class">
+<dt id="gnupg._util.Storage">
+<em class="property">class </em><tt class="descname">Storage</tt><a class="reference internal" href="_modules/gnupg/_util.html#Storage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#gnupg._util.Storage" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <a class="reference external" href="http://docs.python.org/library/stdtypes.html#dict" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">dict</span></tt></a></p>
+<p>A dictionary where keys are stored as class attributes.</p>
+<p>For example, <tt class="docutils literal"><span class="pre">obj.foo</span></tt> can be used in addition to <tt class="docutils literal"><span class="pre">obj['foo']</span></tt>:</p>
+<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">o</span> <span class="o">=</span> <span class="n">Storage</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">o</span><span class="o">.</span><span class="n">a</span>
+<span class="go">1</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">o</span><span class="p">[</span><span class="s">&#39;a&#39;</span><span class="p">]</span>
+<span class="go">1</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">o</span><span class="o">.</span><span class="n">a</span> <span class="o">=</span> <span class="mi">2</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">o</span><span class="p">[</span><span class="s">&#39;a&#39;</span><span class="p">]</span>
+<span class="go">2</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="k">del</span> <span class="n">o</span><span class="o">.</span><span class="n">a</span>
+<span class="gp">&gt;&gt;&gt; </span><span class="n">o</span><span class="o">.</span><span class="n">a</span>
+<span class="go">None</span>
+</pre></div>
+</div>
+</dd></dl>
+
+</div>
+<div class="section" id="about-this-fork">
+<h2>About this fork<a class="headerlink" href="#about-this-fork" title="Permalink to this headline">¶</a></h2>
+<p>This is a modified version of <a class="reference external" href="https://code.google.com/p/python-gnupg/">python-gnupg</a>, (forked from version 0.3.2) which
+was created by Vinay Sajip, which itself is a modification of GPG.py written
+by Steve Traugott, which in turn is a modification of the pycrypto GnuPG
+interface written by A.M. Kuchling.</p>
+<p>This version is patched to sanitize untrusted inputs, due to the necessity of
+executing <tt class="docutils literal"><span class="pre">subprocess.Popen([...],</span> <span class="pre">shell=True)</span></tt> in order to communicate with
+GnuPG. Several speed improvements were also made based on code profiling, and
+the API has been cleaned up to support an easier, more Pythonic, interaction.</p>
+</div>
+<div class="section" id="previous-authors-documentation">
+<h2>Previous Authors&#8217; Documentation<a class="headerlink" href="#previous-authors-documentation" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt>Steve Traugott&#8217;s documentation:</dt>
+<dd><div class="first last line-block">
+<div class="line"><br /></div>
+<div class="line-block">
+<div class="line">Portions of this module are derived from A.M. Kuchling&#8217;s well-designed</div>
+<div class="line">GPG.py, using Richard Jones&#8217; updated version 1.3, which can be found in</div>
+<div class="line">the pycrypto CVS repository on Sourceforge:</div>
+<div class="line"><br /></div>
+<div class="line"><a class="reference external" href="http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py">http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py</a></div>
+<div class="line"><br /></div>
+<div class="line">This module is <em>not</em> forward-compatible with amk&#8217;s; some of the old</div>
+<div class="line">interface has changed. For instance, since I&#8217;ve added decrypt</div>
+<div class="line">functionality, I elected to initialize with a &#8216;gpghome&#8217; argument instead</div>
+<div class="line">of &#8216;keyring&#8217;, so that gpg can find both the public and secret keyrings.</div>
+<div class="line">I&#8217;ve also altered some of the returned objects in order for the caller to</div>
+<div class="line">not have to know as much about the internals of the result classes.</div>
+<div class="line"><br /></div>
+<div class="line">While the rest of ISconf is released under the GPL, I am releasing this</div>
+<div class="line">single file under the same terms that A.M. Kuchling used for pycrypto.</div>
+<div class="line"><br /></div>
+<div class="line">Steve Traugott, <a class="reference external" href="mailto:stevegt&#37;&#52;&#48;terraluna&#46;org">stevegt<span>&#64;</span>terraluna<span>&#46;</span>org</a></div>
+<div class="line">Thu Jun 23 21:27:20 PDT 2005</div>
+</div>
+</div>
+</dd>
+<dt>Vinay Sajip&#8217;s documentation:</dt>
+<dd><div class="first last line-block">
+<div class="line"><br /></div>
+<div class="line-block">
+<div class="line">This version of the module has been modified from Steve Traugott&#8217;s version</div>
+<div class="line">(see <a class="reference external" href="http://trac.t7a.org/isconf/browser/trunk/lib/python/isconf/GPG.py">http://trac.t7a.org/isconf/browser/trunk/lib/python/isconf/GPG.py</a>) by</div>
+<div class="line">Vinay Sajip to make use of the subprocess module (Steve&#8217;s version uses</div>
+<div class="line">os.fork() and so does not work on Windows). Renamed to gnupg.py to avoid</div>
+<div class="line">confusion with the previous versions.</div>
+<div class="line"><br /></div>
+<div class="line">A unittest harness (test_gnupg.py) has also been added.</div>
+<div class="line"><br /></div>
+<div class="line">Modifications Copyright (C) 2008-2012 Vinay Sajip. All rights reserved.</div>
+</div>
+</div>
+</dd>
+</dl>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="">gnupg package</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="#gnupg-module">gnupg module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#meta-module">meta module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#parsers-module">parsers module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#util-module">util module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#about-this-fork">About this fork</a></li>
+<li class="toctree-l2"><a class="reference internal" href="#previous-authors-documentation">Previous Authors&#8217; Documentation</a></li>
+</ul>
+</li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="index.html" title="gnupg: Python Package Documentation"
+ >previous</a> |
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ >index</a>
+ <br/>
+ <a href="_sources/gnupg.txt"
+ rel="nofollow">Show Source</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html
new file mode 100644
index 0000000..fba5006
--- /dev/null
+++ b/docs/_build/html/index.html
@@ -0,0 +1,147 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>gnupg: Python Package Documentation &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: './',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="#" />
+ <link rel="next" title="gnupg package" href="gnupg.html" />
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="#">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="gnupg.html" title="gnupg package"
+ accesskey="N">next</a> |
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <div class="section" id="gnupg-python-package-documentation">
+<h1>gnupg: Python Package Documentation<a class="headerlink" href="#gnupg-python-package-documentation" title="Permalink to this headline">¶</a></h1>
+<p>A Python interface for handling interactions with GnuPG, including keyfile
+generation, keyring maintainance, import and export, encryption and
+decryption, sending to and recieving from keyservers, and signing and
+verification.</p>
+<p>Contents:</p>
+<div class="toctree-wrapper compound">
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="gnupg.html">gnupg package</a><ul>
+<li class="toctree-l2"><a class="reference internal" href="gnupg.html#gnupg-module">gnupg module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="gnupg.html#meta-module">meta module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="gnupg.html#parsers-module">parsers module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="gnupg.html#util-module">util module</a></li>
+<li class="toctree-l2"><a class="reference internal" href="gnupg.html#about-this-fork">About this fork</a></li>
+<li class="toctree-l2"><a class="reference internal" href="gnupg.html#previous-authors-documentation">Previous Authors&#8217; Documentation</a></li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<div class="section" id="source-license-bug-reports">
+<h1>Source, license, &amp; bug reports<a class="headerlink" href="#source-license-bug-reports" title="Permalink to this headline">¶</a></h1>
+<p>The source code which was used to generate this documentation is accessible by
+clicking the little <cite>source</cite> links next to the docs. Current source code can
+be found in this github <a class="reference external" href="https://github.com/isislovecruft/python-gnupg">repository</a>. The <strong>master</strong> branch always reflects the
+latest release, all releases are tagged with signed, annotated git tags, and
+the <strong>develop</strong> branch represents the state of the next release.</p>
+<p>This package is released under <a class="reference external" href="https://www.gnu.org/licenses/gpl.txt">GPLv3</a> or greater.</p>
+<p>If you find a bug, or would like to request a feature, please use our public
+<a class="reference external" href="https://github.com/isislovecruft/python-gnupg/issues">bugtracker</a> on github. Patches warmly welcome.</p>
+</div>
+<div class="section" id="indices-and-tables">
+<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
+<ul class="simple">
+<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
+<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
+<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
+</ul>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="gnupg.html" title="gnupg package"
+ >next</a> |
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ >index</a>
+ <br/>
+ <a href="_sources/index.txt"
+ rel="nofollow">Show Source</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv
new file mode 100644
index 0000000..ca71a9f
--- /dev/null
+++ b/docs/_build/html/objects.inv
Binary files differ
diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html
new file mode 100644
index 0000000..d61dfe2
--- /dev/null
+++ b/docs/_build/html/py-modindex.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>Python Module Index &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: './',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="index.html" />
+
+
+
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="#" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+
+ <h1>Python Module Index</h1>
+
+ <div class="modindex-jumpbox">
+ <a href="#cap-g"><strong>g</strong></a>
+ </div>
+
+ <table class="indextable modindextable" cellspacing="0" cellpadding="2">
+ <tr class="pcap"><td></td><td>&nbsp;</td><td></td></tr>
+ <tr class="cap" id="cap-g"><td></td><td>
+ <strong>g</strong></td><td></td></tr>
+ <tr>
+ <td><img src="_static/minus.png" class="toggler"
+ id="toggle-1" style="display: none" alt="-" /></td>
+ <td>
+ <a href="gnupg.html#module-gnupg"><tt class="xref">gnupg</tt></a></td><td>
+ <em></em></td></tr>
+ <tr class="cg-1">
+ <td></td>
+ <td>&nbsp;&nbsp;&nbsp;
+ <a href="gnupg.html#module-gnupg._meta"><tt class="xref">gnupg._meta</tt></a></td><td>
+ <em></em></td></tr>
+ <tr class="cg-1">
+ <td></td>
+ <td>&nbsp;&nbsp;&nbsp;
+ <a href="gnupg.html#module-gnupg._parsers"><tt class="xref">gnupg._parsers</tt></a></td><td>
+ <em></em></td></tr>
+ <tr class="cg-1">
+ <td></td>
+ <td>&nbsp;&nbsp;&nbsp;
+ <a href="gnupg.html#module-gnupg._util"><tt class="xref">gnupg._util</tt></a></td><td>
+ <em></em></td></tr>
+ </table>
+
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="#" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html
new file mode 100644
index 0000000..d640571
--- /dev/null
+++ b/docs/_build/html/search.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://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/html; charset=utf-8" />
+
+ <title>Search &mdash; gnupg unknown documentation</title>
+
+ <link rel="stylesheet" href="_static/agogo.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: './',
+ VERSION: 'unknown',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true
+ };
+ </script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <script type="text/javascript" src="_static/searchtools.js"></script>
+ <link rel="top" title="gnupg unknown documentation" href="index.html" />
+ <script type="text/javascript">
+ jQuery(function() { Search.loadIndex("searchindex.js"); });
+ </script>
+
+ <script type="text/javascript" id="searchindexloader"></script>
+
+
+ </head>
+ <body>
+ <div class="header-wrapper">
+ <div class="header">
+ <div class="headertitle"><a
+ href="index.html">gnupg: Python Module Documentation</a></div>
+ <div class="rel">
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ accesskey="I">index</a>
+ </div>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="document">
+
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body">
+
+ <h1 id="search-documentation">Search</h1>
+ <div id="fallback" class="admonition warning">
+ <script type="text/javascript">$('#fallback').hide();</script>
+ <p>
+ Please activate JavaScript to enable the search
+ functionality.
+ </p>
+ </div>
+ <p>
+ From here you can search these documents. Enter your search
+ words into the box below and click "search". Note that the search
+ function will automatically search for all of the words. Pages
+ containing fewer words won't appear in the result list.
+ </p>
+ <form action="" method="get">
+ <input type="text" name="q" value="" />
+ <input type="submit" value="search" />
+ <span id="search-progress" style="padding-left: 10px"></span>
+ </form>
+
+ <div id="search-results">
+
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="sidebar">
+ <h3>Table Of Contents</h3>
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="gnupg.html">gnupg package</a></li>
+</ul>
+
+ <h3 style="margin-top: 1.5em;">Search</h3>
+ <form class="search" action="#" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ <p class="searchtip" style="font-size: 90%">
+ Enter search terms or a module, class or function name.
+ </p>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ <div class="footer-wrapper">
+ <div class="footer">
+ <div class="left">
+ <a href="py-modindex.html" title="Python Module Index"
+ >modules</a> |
+ <a href="genindex.html" title="General Index"
+ >index</a>
+ </div>
+
+ <div class="right">
+
+ <div class="footer">
+ &copy; Copyright 2013-2014, Isis Agora Lovecruft.
+ Last updated on Saturday, 02 August 2014.
+ Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ </div>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js
new file mode 100644
index 0000000..d5f5220
--- /dev/null
+++ b/docs/_build/html/searchindex.js
@@ -0,0 +1 @@
+Search.setIndex({envversion:42,terms:{represent:1,all:[0,1],code:[0,1],namedli:1,chain:1,untrust:1,"_find_ag":1,month:1,"_problem_reason":1,prefix:1,edu:1,follow:1,disk:1,inpt:1,issuer:1,disappear:1,whose:1,privat:1,oracl:1,"const":1,sensit:1,send:[0,1],"_agent_proc":1,program:1,certain:1,under:[0,1],sens:1,clearsign:1,isinst:1,"_read_respons":1,sourc:[],string:1,fals:1,need_passphras:1,prog:1,sig_typ:1,fuction:1,sec_dup:1,veri:1,retriev:1,subprocess:1,steve:1,magic:1,key_set:1,raw_data:1,list:1,iter:1,"try":1,item:1,alice_input:1,shlex:1,stderr:1,verif:[0,1],sajip:1,drop:1,arg_list:1,round:1,gen_key_input:1,pleas:[0,1],malici:1,work:1,pref_typ:1,"_encrypt":1,crow:1,sign:[0,1],second:1,blanklin:1,design:1,pass:1,click:0,use_ag:1,even:1,index:0,keyserv:[0,1],"_field":1,hide:1,sub:1,richard:1,inheritableproperti:1,section:1,falsifi:1,find:[0,1],current:[0,1],delet:1,version:1,"new":1,symmetr:1,"_check_keyserv":1,bytestream:1,method:1,can:[0,1],list_packet:1,hasn:1,full:1,hash:1,n_sig:1,sanitis:1,vinai:1,adversari:1,gener:[0,1],never:1,here:1,behaviour:1,shouldn:1,snack:1,modif:1,"_check_prefer":1,depend:1,subkey_typ:1,modifi:1,sinc:1,valu:1,search:[0,1],"3ff0db166a7476ea":1,brilliant:1,"_generated_keys_gett":1,popen:1,cert:1,unlik:1,doctest:1,menu:1,chang:1,chanc:1,revoc:1,compress_algo:1,elect:1,repositori:[0,1],extra:1,revok:1,keyfil:[0,1],"while":1,filenam:1,api:1,famili:1,trust_fulli:1,instal:1,txt:1,sec_read:1,regex:1,seckei:1,from:[0,1],subkei:1,would:[0,1],memori:1,gnupg_opt:1,pref:1,todai:1,next:[0,1],few:1,trust_text:1,"_deprefix":1,call:1,usr:1,recommend:1,taken:1,scope:1,md5:1,type:1,minor:1,more:1,print1:1,capit:1,print2:1,desir:1,peopl:1,hundr:1,relat:1,line:1,notic:1,genkei:1,warn:1,"_make_binary_stream":1,flag:1,indic:[],particular:1,known:1,obj:1,cipher_algo:1,must:1,need_passphrase_sym:1,none:1,imported_rsa:1,join:1,thread:1,otrust:1,alic:1,uniqu:1,name_email:1,fli:1,descriptor:1,kwarg:1,del:1,whatev:1,wwwkei:1,meet:1,purpos:1,fget:1,control:1,gplv3:0,kuchl:1,stream:1,give:1,process:1,gpgsm:1,share:1,uat:1,accept:1,tag:0,"_make_arg":1,want:1,"_copy_data":1,occur:1,whichev:1,protectedopt:1,aes256:1,enc:1,end:1,secur:1,tamper:1,grudgingli:1,key_data:1,how:1,sig:1,sever:1,fpr:1,instead:1,config:1,updat:1,map:1,"_sanitise_list":1,alwai:0,passwordless:1,after:1,differenti:1,reflect:0,befor:1,okai:1,rmtree:1,mai:1,underscor:1,data:1,physic:1,man:1,handl:[0,1],delete_kei:1,attempt:1,classmethod:1,seriou:1,stdin:1,correspond:1,element:1,issu:1,inform:1,ambigi:1,combin:1,allow:1,enter:1,callabl:1,key_id:1,order:1,oper:1,help:1,"_match_version_str":1,midnight:1,soon:1,own:1,through:1,describ:1,n_revoc:1,deleteresult:1,hexidecim:1,print_funct:1,digest:1,paramet:1,write:1,group:1,funni:1,fix:1,better:1,window:1,"_is_gpg1":1,trust_level:1,"_handle_statu":1,"_read_data":1,alter:1,non:1,good:1,n_uid:1,greater:[0,1],thei:1,python:[],timestamp:1,subdirectori:1,dai:1,initi:1,fingerprint:1,detach:1,possess:1,down:1,term:1,t7a:1,"_meta":1,trac:1,anyth:1,edit:1,level:1,userid:1,verify_fil:1,separ:1,micro:1,token:1,each:1,debug:1,found:[0,1],unicod:1,csr:1,mean:1,subset:1,everyth:1,reliabl:1,hard:1,"_get_options_group":1,realli:1,ensur:1,keypair:1,"static":1,expect:1,year:1,our:[0,1],meth:1,name_com:1,"_generated_kei":1,orient:1,special:1,out:1,variabl:1,suppos:1,safeti:1,space:1,armor:1,miss:1,access:[0,1],rev:1,create_uid_email:1,"_recv_kei":1,your:1,expire_timestamp:1,mess:1,suitabl:1,rel:1,print:1,sha1:1,metaclass:1,correct:1,dsa:1,name_r:1,usageerror:1,gpgmeta:1,upon:1,runtimeerror:1,manipul:1,"__remove_path__":1,pub:1,"_get_all_gnupg_opt":1,reason:1,base:1,dictionari:1,"_export_ownertrust":1,ask:1,org:1,"byte":1,trust_ultim:1,sekrit:1,care:1,import_kei:1,precaut:1,pubr:1,importresult:1,could:1,omit:1,"_result_map":1,fqdn:1,initialis:1,emul:1,thing:1,length:1,"19860426t042640":1,place:1,isn:1,pycrypto:1,nodata:1,confus:1,think:1,frequent:1,first:1,origin:1,softwar:1,major:1,suffix:1,directli:1,purport:1,arrai:1,number:1,necess:1,date:1,instruct:1,alreadi:1,done:1,least:1,pgp:1,owner:1,stabl:1,open:1,primari:1,hexstr:1,size:1,gpl:1,given:1,pubkey_fingerprint:1,strict:1,unknown:1,top:1,gpg:1,list_sig:1,system:1,messag:1,name:1,attach:1,attack:1,master:0,too:1,pathext:1,stevegt:1,outstream:1,store:1,low:1,shell:1,option:1,copi:1,rsa:1,specifi:1,forward:1,separate_keyr:1,github:0,pars:1,mostli:1,consult:1,presumedli:1,gethostnam:1,exactli:1,than:1,albeit:1,ciphertext:1,keyid:1,prevent:1,keysign:1,remov:1,recv_kei:1,zero:1,charact:1,matter:1,friend:1,str:1,were:1,exp:1,"0x12345678":1,"_is_list_or_tupl":1,browser:1,"_is_str":1,respons:1,beforehand:1,ani:1,sit:1,wai:1,author_info:1,expir:1,increment:1,reserv:1,need:1,seem:1,turn:1,userid_hint:1,always_trust:1,entireti:1,not_import:1,engin:1,"__new__":1,lib:1,callback:1,destroi:1,latter:1,contact:1,note:1,mix:1,"_is_stream":1,secr:1,take:1,annot:0,sanit:1,environ:1,zlib:1,maintain:[0,1],mit:1,save_batchfil:1,uppercas:1,compat:1,begin:1,sure:1,unless:1,exec:1,usernam:1,object:1,compress:1,what:1,discov:1,decrypt_fil:1,digest_algo:1,problem_reason:1,cipher:1,gpg2:1,letter:1,net:1,"class":1,n_subk:1,trustdb:1,prove:1,renam:1,exc:1,url:1,doc:[0,1],later:1,request:[0,1],"_find_binari":1,doe:1,pipe:1,anoth:1,part:1,subkey_usag:1,determin:1,warmli:0,usual:1,shell_input:1,seckey1:1,fact:1,recipi:1,"_parser":1,show:1,"__str__":1,random:1,syntax:1,happili:1,permiss:1,hack:1,lookuperror:1,alice_kei:1,first_word:1,"_generated_keys_sett":1,absolut:1,onli:1,explicitli:1,locat:1,just:1,facil:1,unattend:1,explain:1,writer:1,releas:[0,1],trust_nev:1,should:1,"_batch_limit":1,busi:1,dict:1,local:1,meant:1,info:1,variou:1,get:1,stop:1,secondari:1,cannot:1,f_ok:1,report:[],gen:1,requir:1,ssb:1,bar:1,"_next_year":1,ever:1,key_creat:1,borrow:1,"public":[0,1],rfc:1,provid:1,bad:1,stupid:1,statist:1,though:1,contain:1,comma:1,where:1,instream:1,summari:1,happen:1,certif:1,set:1,commandlin:1,signatur:1,tree:1,cryptanalyt:1,still:1,packet:1,"_has_readwrit":1,see:1,sec:1,result:1,arg:1,fail:1,close:1,becaus:1,crt:1,deriv:1,appear:1,statu:1,detect:1,cleartext:1,correctli:1,"_open_subprocess":1,speed:1,someth:1,creation_d:1,traugott:1,configur:1,written:1,at_exit:1,between:1,ciphernam:1,progress:1,signature_id:1,hkp:1,attribut:1,altern:1,verifi:1,accord:1,unmodifi:1,func:1,kei:1,numer:1,overflow:1,codec:1,homedir:1,bak:1,extens:1,lowercas:1,entir:1,wear:1,frozenset:1,disallow:1,embed:1,key_length:1,addit:1,verbos:1,both:1,protect:1,last:1,delimit:1,howev:1,pdt:1,etc:1,instanc:1,gen_kei:1,agent:1,improv:1,comment:1,within:1,"_handle_io":1,address:1,wrap:1,except:1,header:1,key_not_cr:1,differ:1,key_input:1,path:1,pubkey1:1,respect:1,"_homedir_gett":1,assum:1,xkcd:1,reciev:[0,1],"_is_gpg2":1,gpgbase:1,bytesio:1,sig_hash_also:1,patch:[0,1],due:1,been:1,mark:1,rvk:1,secret:1,much:1,interpret:1,basic:1,isconf:1,valueerror:1,fset:1,gist:1,is_gpg1:1,is_gpg2:1,xxx:1,convert:1,append:1,argument:1,assert:1,"_now":1,euid:1,a3adb67a2cdb8b35:1,input:1,openpgp:1,export_kei:1,former:1,wrapper:1,"case":1,ugli:1,ident:1,look:1,properti:1,sourceforg:1,easier:1,getfilesystemencod:1,calcul:1,abov:1,error:1,bin:1,ordereddict:1,"_create_trustdb":1,default_preference_list:1,key2:1,key1:1,them:1,contributor:1,"default":1,itself:1,conf:1,"return":1,mod:1,shutil:1,ascii:1,fdel:1,"__init__":1,"_fix_trustdb":1,develop:0,welcom:0,"_homedir_sett":1,setpref:1,alphabet:1,make:1,key_grip:1,same:1,binari:1,epoch:1,isspac:1,split:1,pkd:1,fill:1,singl:1,higher:1,week:1,safe:1,"_make_passphras":1,hostnam:1,keyr:[0,1],"_import_ownertrust":1,effect:1,capabl:1,assign:1,rais:1,user:1,"_create_if_necessari":1,pinentri:1,implement:1,drain:1,scenario:1,thu:1,summon:1,well:1,inherit:1,without:1,person:1,exampl:1,command:1,programm:1,listkei:1,left:1,explan:1,"_is_hex":1,construct:1,protocol:1,execut:1,photo:1,armour:1,exclud:1,obtain:1,rest:1,trust:1,via:1,kill:1,default_kei:1,touch:1,passphras:1,simultan:1,list_kei:1,yet:1,pyproperty_typ:1,hah:1,gather:1,now:1,"_hyphen":1,"_make_random_str":1,easi:1,also:1,pubkei:1,elg:1,littl:0,"_decode_error":1,add:1,valid:1,els:1,har:1,save:1,scatterbrainedli:1,latest:0,match:1,build:1,real:1,amk:1,which:[0,1],format:1,read:1,prefer:1,piec:1,subkey_length:1,punctuat:1,know:1,no_user_id:1,bit:1,password:1,associ:1,python3:1,python2:1,like:[0,1],specif:1,substr:1,whitespac:1,manual:1,integ:1,terraluna:1,collect:1,"boolean":1,necessari:1,either:1,have:1,add_prefix:1,colon:1,inter:1,"_sign_fil":1,page:[0,1],unabl:1,tmpfile:1,"_collect_output":1,old:1,often:1,the_rest:1,"_which":1,acknowledg:1,interv:1,interact:[0,1],some:1,back:1,"_is_allow":1,isfil:1,intern:1,unspecifi:1,"export":[0,1],unchang:1,home:1,tmp:1,ownertrust:1,lead:1,psutil:1,avoid:1,normal:1,exit:1,iso:1,key_usag:1,sig_fil:1,unsanit:1,auth:1,foo:1,trunk:1,refer:1,pilfer:1,plu:1,who:1,run:1,direcori:1,uncompress:1,expire_d:1,insecur:1,usag:1,symlink:1,broken:1,although:1,output:1,simpler:1,unsaf:1,actual:1,zip:1,materi:1,commun:1,http:1,viewvc:1,distinct:1,tranlat:1,"_separate_keyword":1,commit:1,disabl:1,block:1,"_threaded_copy_data":1,repair:1,"__future__":1,"_ok_reason":1,status_cod:1,listpacket:1,lastli:1,encod:1,gpghome:1,automat:1,three:1,printprint:1,right:1,test_gnupg:1,strip:1,"_sanitis":1,"import":[0,1],hyphen:1,batch:1,storag:1,digestnam:1,stare:1,unlock:1,git:0,deal:1,suffici:1,aren:1,support:1,"long":1,avail:1,start:1,reli:1,gid:1,interfac:[0,1],includ:[0,1],handle_statu:1,trust_undefin:1,"_write_passphras":1,sha512:1,descrobject:1,"function":1,creation:1,form:1,sec_import:1,tupl:1,jun:1,"_util":1,find_encod:1,content:[0,1],key_typ:1,state:0,link:[0,1],translat:1,newer:1,branch:[0,1],don:1,cryptograph:1,"true":1,sig_timestamp:1,sent:1,count:1,concaten:1,made:1,utf:1,attr:1,absens:1,possibl:1,whether:1,notat:1,caller:1,eighteen:1,displai:1,below:1,unittest:1,public_kei:1,otherwis:1,problem:1,remaind:1,similar:1,email:1,esca:1,sort:1,featur:[0,1],uid:1,creat:1,"int":1,hardcod:1,bugtrack:0,decrypt:[0,1],doesn:1,repres:[0,1],twist:1,proutil:1,exist:1,file:1,"_utc_epoch":1,utc:1,check:1,probabl:1,incorrect:1,again:1,bzip2:1,encrypt:[0,1],quot:1,grp:1,crypt:1,when:1,detail:1,invalid:1,field:1,other:1,bool:1,copyright:1,rememb:1,presenc:1,test:1,pathnam:1,you:[0,1],"_fix_unsaf":1,"_is_fil":1,intend:1,clean:1,stringio:1,put:1,symbol:1,insensit:1,log:1,consid:1,easili:1,param:1,reduc:1,"_count":1,receiv:1,faster:1,algorithm:1,directori:1,sig_algo:1,alphanumer:1,portion:1,algo:1,ignor:1,invok:1,potenti:1,time:1,escap:1,profil:1,hello:1,jone:1,trust_margin:1},objtypes:{"0":"py:module","1":"py:function","2":"py:exception","3":"py:method","4":"py:attribute","5":"py:class","6":"py:classmethod","7":"py:staticmethod"},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","exception","Python exception"],"3":["py","method","Python method"],"4":["py","attribute","Python attribute"],"5":["py","class","Python class"],"6":["py","classmethod","Python class method"],"7":["py","staticmethod","Python static method"]},filenames:["index","gnupg"],titles:["gnupg: Python Package Documentation","gnupg package"],objects:{"":{gnupg:[1,0,0,"-"]},"gnupg._meta.GPGMeta":{"__new__":[1,7,1,""],"_find_agent":[1,6,1,""]},"gnupg._parsers":{"_is_hex":[1,1,1,""],UsageError:[1,2,1,""],Verify:[1,5,1,""],"_get_options_group":[1,1,1,""],"_is_allowed":[1,1,1,""],GenKey:[1,5,1,""],ImportResult:[1,5,1,""],"_check_preferences":[1,1,1,""],"_fix_unsafe":[1,1,1,""],Crypt:[1,5,1,""],ListPackets:[1,5,1,""],progress:[1,1,1,""],ListKeys:[1,5,1,""],"_sanitise_list":[1,1,1,""],"_is_string":[1,1,1,""],"_check_keyserver":[1,1,1,""],ProtectedOption:[1,2,1,""],"_get_all_gnupg_options":[1,1,1,""],DeleteResult:[1,5,1,""],"_sanitise":[1,1,1,""],"_hyphenate":[1,1,1,""],Sign:[1,5,1,""],nodata:[1,1,1,""]},"gnupg._parsers.Crypt":{status:[1,4,1,""],ok:[1,4,1,""],"_handle_status":[1,3,1,""],data:[1,4,1,""]},"gnupg._parsers.Verify":{TRUST_LEVELS:[1,4,1,""],status:[1,4,1,""],TRUST_NEVER:[1,4,1,""],expire_timestamp:[1,4,1,""],pubkey_fingerprint:[1,4,1,""],TRUST_FULLY:[1,4,1,""],timestamp:[1,4,1,""],TRUST_MARGINAL:[1,4,1,""],"_handle_status":[1,3,1,""],creation_date:[1,4,1,""],username:[1,4,1,""],trust_text:[1,4,1,""],valid:[1,4,1,""],TRUST_ULTIMATE:[1,4,1,""],TRUST_UNDEFINED:[1,4,1,""],fingerprint:[1,4,1,""],key_id:[1,4,1,""],signature_id:[1,4,1,""],sig_timestamp:[1,4,1,""],trust_level:[1,4,1,""]},"gnupg._meta.GPGBase":{"_generated_keys_getter":[1,3,1,""],keyserver:[1,4,1,""],"_encrypt":[1,3,1,""],default_preference_list:[1,4,1,""],"_homedir_getter":[1,3,1,""],"_handle_io":[1,3,1,""],"_open_subprocess":[1,3,1,""],"_homedir_setter":[1,3,1,""],"__remove_path__":[1,3,1,""],"_collect_output":[1,3,1,""],"_make_args":[1,3,1,""],homedir:[1,4,1,""],"_read_data":[1,3,1,""],"_generated_keys":[1,4,1,""],"_generated_keys_setter":[1,3,1,""],"_recv_keys":[1,3,1,""],"_read_response":[1,3,1,""],"__init__":[1,3,1,""],"_sign_file":[1,3,1,""]},"gnupg.GPG":{"_create_trustdb":[1,3,1,""],decrypt:[1,3,1,""],sign:[1,3,1,""],verify_file:[1,3,1,""],encrypt:[1,3,1,""],recv_keys:[1,3,1,""],verify:[1,3,1,""],export_keys:[1,3,1,""],"_batch_limit":[1,4,1,""],decrypt_file:[1,3,1,""],import_keys:[1,3,1,""],is_gpg1:[1,3,1,""],is_gpg2:[1,3,1,""],"_import_ownertrust":[1,3,1,""],delete_keys:[1,3,1,""],"_export_ownertrust":[1,3,1,""],list_packets:[1,3,1,""],gen_key:[1,3,1,""],"_fix_trustdb":[1,3,1,""],list_keys:[1,3,1,""],list_sigs:[1,3,1,""],gen_key_input:[1,3,1,""]},"gnupg._parsers.ImportResult":{fingerprints:[1,4,1,""],"_handle_status":[1,3,1,""],results:[1,4,1,""],summary:[1,3,1,""],"_problem_reason":[1,4,1,""],"_ok_reason":[1,4,1,""],"_counts":[1,4,1,""],x:[1,4,1,""],"_fields":[1,4,1,""]},"gnupg._parsers.Sign":{what:[1,4,1,""],sig_hash_also:[1,4,1,""],fingerprint:[1,4,1,""],sig_algo:[1,4,1,""],"_handle_status":[1,3,1,""],sig_type:[1,4,1,""],timestamp:[1,4,1,""]},"gnupg._parsers.ListKeys":{uid:[1,3,1,""],"_handle_status":[1,3,1,""],pub:[1,3,1,""],sec:[1,3,1,""],key:[1,3,1,""],fpr:[1,3,1,""],sub:[1,3,1,""]},"gnupg._util":{"_threaded_copy_data":[1,1,1,""],"_is_stream":[1,1,1,""],Storage:[1,5,1,""],"_make_random_string":[1,1,1,""],"_is_gpg1":[1,1,1,""],"_utc_epoch":[1,1,1,""],"_copy_data":[1,1,1,""],"_is_gpg2":[1,1,1,""],"_write_passphrase":[1,1,1,""],"_is_list_or_tuple":[1,1,1,""],"_which":[1,1,1,""],"_deprefix":[1,1,1,""],"_find_binary":[1,1,1,""],author_info:[1,1,1,""],"_create_if_necessary":[1,1,1,""],"_has_readwrite":[1,1,1,""],"_make_binary_stream":[1,1,1,""],"_make_passphrase":[1,1,1,""],"_is_file":[1,1,1,""],InheritableProperty:[1,5,1,""],find_encodings:[1,1,1,""],"_next_year":[1,1,1,""],"_now":[1,1,1,""],"_match_version_string":[1,1,1,""],create_uid_email:[1,1,1,""],"_separate_keyword":[1,1,1,""]},gnupg:{"_parsers":[1,0,0,"-"],GPG:[1,5,1,""],"_meta":[1,0,0,"-"],"_util":[1,0,0,"-"]},"gnupg._parsers.ListPackets":{status:[1,4,1,""],"_handle_status":[1,3,1,""],need_passphrase:[1,4,1,""],userid_hint:[1,4,1,""],need_passphrase_sym:[1,4,1,""]},"gnupg._meta":{GPGMeta:[1,5,1,""],GPGBase:[1,5,1,""]},"gnupg._parsers.DeleteResult":{problem_reason:[1,4,1,""],"_handle_status":[1,3,1,""]},"gnupg._parsers.GenKey":{keyring:[1,4,1,""],"_handle_status":[1,3,1,""],type:[1,4,1,""],secring:[1,4,1,""]}},titleterms:{fork:1,about:1,sourc:0,thi:1,author:1,python:0,modul:1,previou:1,parser:1,indic:0,util:1,packag:[0,1],meta:1,gnupg:[0,1],tabl:0,report:0,document:[0,1],bug:0,licens:0}}) \ No newline at end of file