diff options
Diffstat (limited to 'doc/html/M2Crypto.html')
-rw-r--r-- | doc/html/M2Crypto.html | 5034 |
1 files changed, 737 insertions, 4297 deletions
diff --git a/doc/html/M2Crypto.html b/doc/html/M2Crypto.html index b659a5e..ff8cc46 100644 --- a/doc/html/M2Crypto.html +++ b/doc/html/M2Crypto.html @@ -1,19 +1,18 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml"> +<html> <head> - <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>M2Crypto Package — M2Crypto documentation</title> <link rel="stylesheet" href="_static/alabaster.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> - <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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/language_data.js"></script> + <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> + <script src="_static/jquery.js"></script> + <script src="_static/underscore.js"></script> + <script src="_static/doctools.js"></script> + <script src="_static/language_data.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="SSL Package" href="M2Crypto.SSL.html" /> @@ -38,4559 +37,1089 @@ <h1>M2Crypto Package<a class="headerlink" href="#m2crypto-package" title="Permalink to this headline">¶</a></h1> <div class="section" id="id1"> <h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">M2Crypto</span></code> Package<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2> -<span class="target" id="module-M2Crypto.__init__"></span></div> -<div class="section" id="module-M2Crypto.ASN1"> -<span id="asn1-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">ASN1</span></code> Module<a class="headerlink" href="#module-M2Crypto.ASN1" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.ASN1.ASN1_Integer"> -<em class="property">class </em><code class="descclassname">M2Crypto.ASN1.</code><code class="descname">ASN1_Integer</code><span class="sig-paren">(</span><em>asn1int</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_Integer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_Integer" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_Integer.m2_asn1_integer_free"> -<code class="descname">m2_asn1_integer_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.ASN1.ASN1_Integer.m2_asn1_integer_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.ASN1.ASN1_Object"> -<em class="property">class </em><code class="descclassname">M2Crypto.ASN1.</code><code class="descname">ASN1_Object</code><span class="sig-paren">(</span><em>asn1obj</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_Object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_Object" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_Object.m2_asn1_object_free"> -<code class="descname">m2_asn1_object_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.ASN1.ASN1_Object.m2_asn1_object_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.ASN1.ASN1_String"> -<em class="property">class </em><code class="descclassname">M2Crypto.ASN1.</code><code class="descname">ASN1_String</code><span class="sig-paren">(</span><em>asn1str</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_String"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_String" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_String.as_text"> -<code class="descname">as_text</code><span class="sig-paren">(</span><em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_String.as_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_String.as_text" title="Permalink to this definition">¶</a></dt> -<dd><p>Output an ASN1_STRING structure according to the set flags.</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>flags</strong> – determine the format of the output by using -predetermined constants, see ASN1_STRING_print_ex(3) -manpage for their meaning.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">output an ASN1_STRING structure.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_String.m2_asn1_string_free"> -<code class="descname">m2_asn1_string_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.ASN1.ASN1_String.m2_asn1_string_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.ASN1.ASN1_TIME"> -<em class="property">class </em><code class="descclassname">M2Crypto.ASN1.</code><code class="descname">ASN1_TIME</code><span class="sig-paren">(</span><em>asn1_time=None</em>, <em>_pyfree=0</em>, <em>asn1_utctime=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_TIME"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_TIME" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_TIME.get_datetime"> -<code class="descname">get_datetime</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_TIME.get_datetime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_TIME.get_datetime" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_TIME.m2_asn1_time_free"> -<code class="descname">m2_asn1_time_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.ASN1.ASN1_TIME.m2_asn1_time_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_TIME.set_datetime"> -<code class="descname">set_datetime</code><span class="sig-paren">(</span><em>date</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_TIME.set_datetime"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_TIME.set_datetime" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_TIME.set_string"> -<code class="descname">set_string</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_TIME.set_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_TIME.set_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Set time from UTC string.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.ASN1_TIME.set_time"> -<code class="descname">set_time</code><span class="sig-paren">(</span><em>time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#ASN1_TIME.set_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.ASN1_TIME.set_time" title="Permalink to this definition">¶</a></dt> -<dd><p>Set time from seconds since epoch (int).</p> -</dd></dl> - -</dd></dl> - -<dl class="attribute"> -<dt id="M2Crypto.ASN1.ASN1_UTCTIME"> -<code class="descclassname">M2Crypto.ASN1.</code><code class="descname">ASN1_UTCTIME</code><a class="headerlink" href="#M2Crypto.ASN1.ASN1_UTCTIME" title="Permalink to this definition">¶</a></dt> -<dd><p>alias of <a class="reference internal" href="#M2Crypto.ASN1.ASN1_TIME" title="M2Crypto.ASN1.ASN1_TIME"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.ASN1.ASN1_TIME</span></code></a></p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.ASN1.LocalTimezone"> -<em class="property">class </em><code class="descclassname">M2Crypto.ASN1.</code><code class="descname">LocalTimezone</code><a class="reference internal" href="_modules/M2Crypto/ASN1.html#LocalTimezone"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.LocalTimezone" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">datetime.tzinfo</span></code></p> -<p>Localtimezone from datetime manual.</p> -<dl class="method"> -<dt id="M2Crypto.ASN1.LocalTimezone.dst"> -<code class="descname">dst</code><span class="sig-paren">(</span><em>dt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#LocalTimezone.dst"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.LocalTimezone.dst" title="Permalink to this definition">¶</a></dt> -<dd><p>datetime -> DST offset as timedelta positive east of UTC.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.LocalTimezone.tzname"> -<code class="descname">tzname</code><span class="sig-paren">(</span><em>dt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#LocalTimezone.tzname"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.LocalTimezone.tzname" title="Permalink to this definition">¶</a></dt> -<dd><p>datetime -> string name of time zone.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ASN1.LocalTimezone.utcoffset"> -<code class="descname">utcoffset</code><span class="sig-paren">(</span><em>dt</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ASN1.html#LocalTimezone.utcoffset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ASN1.LocalTimezone.utcoffset" title="Permalink to this definition">¶</a></dt> -<dd><p>datetime -> timedelta showing offset from UTC, negative values indicating West of UTC</p> -</dd></dl> - -</dd></dl> - -</div> -<div class="section" id="module-M2Crypto.AuthCookie"> -<span id="authcookie-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">AuthCookie</span></code> Module<a class="headerlink" href="#module-M2Crypto.AuthCookie" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.AuthCookie.AuthCookie"> -<em class="property">class </em><code class="descclassname">M2Crypto.AuthCookie.</code><code class="descname">AuthCookie</code><span class="sig-paren">(</span><em>expiry</em>, <em>data</em>, <em>dough</em>, <em>mac</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.data"> -<code class="descname">data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.data" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the data portion of the cookie.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.expiry"> -<code class="descname">expiry</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.expiry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.expiry" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the cookie’s expiry time.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.headerValue"> -<code class="descname">headerValue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.headerValue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.headerValue" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.isExpired"> -<code class="descname">isExpired</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.isExpired"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.isExpired" title="Permalink to this definition">¶</a></dt> -<dd><p>Return 1 if the cookie has expired, 0 otherwise.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.mac"> -<code class="descname">mac</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.mac"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.mac" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the cookie’s MAC.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.name"> -<code class="descname">name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.name" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.output"> -<code class="descname">output</code><span class="sig-paren">(</span><em>header='Set-Cookie:'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.output"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.output" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the cookie’s output in “Set-Cookie” format.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookie.value"> -<code class="descname">value</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookie.value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookie.value" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the cookie’s output minus the “Set-Cookie: ” portion.</p> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.AuthCookie.AuthCookieJar"> -<em class="property">class </em><code class="descclassname">M2Crypto.AuthCookie.</code><code class="descname">AuthCookieJar</code><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookieJar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookieJar" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookieJar.isGoodCookie"> -<code class="descname">isGoodCookie</code><span class="sig-paren">(</span><em>cookie</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookieJar.isGoodCookie"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookieJar.isGoodCookie" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookieJar.isGoodCookieString"> -<code class="descname">isGoodCookieString</code><span class="sig-paren">(</span><em>cookie_str</em>, <em>_debug=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookieJar.isGoodCookieString"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookieJar.isGoodCookieString" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.AuthCookie.AuthCookieJar.makeCookie"> -<code class="descname">makeCookie</code><span class="sig-paren">(</span><em>expiry</em>, <em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#AuthCookieJar.makeCookie"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.AuthCookieJar.makeCookie" title="Permalink to this definition">¶</a></dt> -<dd><p>Make a cookie</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>expiry</strong> – expiration time (float in seconds)</li> -<li><strong>data</strong> – cookie content</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">AuthCookie object</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.AuthCookie.mix"> -<code class="descclassname">M2Crypto.AuthCookie.</code><code class="descname">mix</code><span class="sig-paren">(</span><em>expiry</em>, <em>data</em>, <em>format='exp=%f&data=%s&digest='</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#mix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.mix" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.AuthCookie.unmix"> -<code class="descclassname">M2Crypto.AuthCookie.</code><code class="descname">unmix</code><span class="sig-paren">(</span><em>dough</em>, <em>regex=re.compile('exp=(\\d+\\.\\d+)&data=(.+)&digest=(\\S*)')</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#unmix"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.unmix" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.AuthCookie.unmix3"> -<code class="descclassname">M2Crypto.AuthCookie.</code><code class="descname">unmix3</code><span class="sig-paren">(</span><em>dough</em>, <em>regex=re.compile('exp=(\\d+\\.\\d+)&data=(.+)&digest=(\\S*)')</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/AuthCookie.html#unmix3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.AuthCookie.unmix3" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - </div> -<div class="section" id="module-M2Crypto.BIO"> -<span id="bio-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">BIO</span></code> Module<a class="headerlink" href="#module-M2Crypto.BIO" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.BIO.BIO"> -<em class="property">class </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">BIO</code><span class="sig-paren">(</span><em>bio=None</em>, <em>_pyfree=0</em>, <em>_close_cb=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>Abstract object interface to the BIO API.</p> -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.bio_ptr"> -<code class="descname">bio_ptr</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.BIO.bio_ptr" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.close"> -<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.fileno"> -<code class="descname">fileno</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.fileno"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.fileno" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.flush"> -<code class="descname">flush</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.flush"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.flush" title="Permalink to this definition">¶</a></dt> -<dd><p>Flush the buffers.</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">1 for success, and 0 or -1 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.m2_bio_free"> -<code class="descname">m2_bio_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.BIO.m2_bio_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.read"> -<code class="descname">read</code><span class="sig-paren">(</span><em>size=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.read" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.readable"> -<code class="descname">readable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.readable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.readable" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.readline"> -<code class="descname">readline</code><span class="sig-paren">(</span><em>size=4096</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.readline"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.readline" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.readlines"> -<code class="descname">readlines</code><span class="sig-paren">(</span><em>sizehint='ignored'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.readlines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.readlines" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.reset"> -<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.reset" title="Permalink to this definition">¶</a></dt> -<dd><p>Set the bio to its initial state.</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">1 for success, and 0 or -1 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.seek"> -<code class="descname">seek</code><span class="sig-paren">(</span><em>off</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.seek"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.seek" title="Permalink to this definition">¶</a></dt> -<dd><p>Seek to the specified absolute offset.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.should_read"> -<code class="descname">should_read</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.should_read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.should_read" title="Permalink to this definition">¶</a></dt> -<dd><p>Should we read more data?</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.should_retry"> -<code class="descname">should_retry</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.should_retry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.should_retry" title="Permalink to this definition">¶</a></dt> -<dd><p>Can the call be attempted again, or was there an error -ie do_handshake</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.should_write"> -<code class="descname">should_write</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.should_write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.should_write" title="Permalink to this definition">¶</a></dt> -<dd><p>Should we write more data?</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.tell"> -<code class="descname">tell</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.tell"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.tell" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the current offset.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.write"> -<code class="descname">write</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.write" title="Permalink to this definition">¶</a></dt> -<dd><p>Write data to BIO.</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">either data written, or [0, -1] for nothing written, --2 not implemented</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.write_close"> -<code class="descname">write_close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.write_close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.write_close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.BIO.writeable"> -<code class="descname">writeable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIO.writeable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIO.writeable" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.BIO.BIOError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">BIOError</code><a class="reference internal" href="_modules/M2Crypto/BIO.html#BIOError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.BIOError" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ValueError</span></code></p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.BIO.CipherStream"> -<em class="property">class </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">CipherStream</code><span class="sig-paren">(</span><em>obio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#CipherStream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.CipherStream" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.BIO.BIO" title="M2Crypto.BIO.BIO"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.BIO.BIO</span></code></a></p> -<p>Object interface to BIO_f_cipher.</p> -<dl class="attribute"> -<dt id="M2Crypto.BIO.CipherStream.SALT_LEN"> -<code class="descname">SALT_LEN</code><em class="property"> = 8</em><a class="headerlink" href="#M2Crypto.BIO.CipherStream.SALT_LEN" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.CipherStream.close"> -<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#CipherStream.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.CipherStream.close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.CipherStream.m2_bio_free"> -<code class="descname">m2_bio_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.CipherStream.m2_bio_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.CipherStream.m2_bio_pop"> -<code class="descname">m2_bio_pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.CipherStream.m2_bio_pop" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.CipherStream.set_cipher"> -<code class="descname">set_cipher</code><span class="sig-paren">(</span><em>algo</em>, <em>key</em>, <em>iv</em>, <em>op</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#CipherStream.set_cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.CipherStream.set_cipher" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.CipherStream.write_close"> -<code class="descname">write_close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#CipherStream.write_close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.CipherStream.write_close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.BIO.File"> -<em class="property">class </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">File</code><span class="sig-paren">(</span><em>pyfile</em>, <em>close_pyfile=1</em>, <em>mode='rb'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#File"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.File" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.BIO.BIO" title="M2Crypto.BIO.BIO"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.BIO.BIO</span></code></a></p> -<p>Object interface to BIO_s_pyfd.</p> -<p>This class interfaces Python to OpenSSL functions that expect BIO. For -general file manipulation in Python, use Python’s builtin file object.</p> -<dl class="method"> -<dt id="M2Crypto.BIO.File.close"> -<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#File.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.File.close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.File.flush"> -<code class="descname">flush</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#File.flush"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.File.flush" title="Permalink to this definition">¶</a></dt> -<dd><p>Flush the buffers.</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">1 for success, and 0 or -1 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.File.reset"> -<code class="descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#File.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.File.reset" title="Permalink to this definition">¶</a></dt> -<dd><p>Set the bio to its initial state.</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">0 for success, and -1 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.BIO.IOBuffer"> -<em class="property">class </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">IOBuffer</code><span class="sig-paren">(</span><em>under_bio</em>, <em>mode='rwb'</em>, <em>_pyfree=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#IOBuffer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.IOBuffer" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.BIO.BIO" title="M2Crypto.BIO.BIO"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.BIO.BIO</span></code></a></p> -<p>Object interface to BIO_f_buffer.</p> -<p>Its principal function is to be BIO_push()’ed on top of a BIO_f_ssl, so -that makefile() of said underlying SSL socket works.</p> -<dl class="method"> -<dt id="M2Crypto.BIO.IOBuffer.close"> -<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#IOBuffer.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.IOBuffer.close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.IOBuffer.m2_bio_free"> -<code class="descname">m2_bio_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.IOBuffer.m2_bio_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.IOBuffer.m2_bio_pop"> -<code class="descname">m2_bio_pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.IOBuffer.m2_bio_pop" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.BIO.MemoryBuffer"> -<em class="property">class </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">MemoryBuffer</code><span class="sig-paren">(</span><em>data=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#MemoryBuffer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.MemoryBuffer" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.BIO.BIO" title="M2Crypto.BIO.BIO"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.BIO.BIO</span></code></a></p> -<p>Object interface to BIO_s_mem.</p> -<p>Empirical testing suggests that this class performs less well than -cStringIO, because cStringIO is implemented in C, whereas this class -is implemented in Python. Thus, the recommended practice is to use -cStringIO for regular work and convert said cStringIO object to -a MemoryBuffer object only when necessary.</p> -<dl class="method"> -<dt id="M2Crypto.BIO.MemoryBuffer.close"> -<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.MemoryBuffer.close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.MemoryBuffer.getvalue"> -<code class="descname">getvalue</code><span class="sig-paren">(</span><em>size=0</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.MemoryBuffer.getvalue" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.MemoryBuffer.read"> -<code class="descname">read</code><span class="sig-paren">(</span><em>size=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#MemoryBuffer.read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.MemoryBuffer.read" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.MemoryBuffer.read_all"> -<code class="descname">read_all</code><span class="sig-paren">(</span><em>size=0</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.BIO.MemoryBuffer.read_all" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.MemoryBuffer.write_close"> -<code class="descname">write_close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#MemoryBuffer.write_close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.MemoryBuffer.write_close" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.BIO.SSLBio"> -<em class="property">class </em><code class="descclassname">M2Crypto.BIO.</code><code class="descname">SSLBio</code><span class="sig-paren">(</span><em>_pyfree=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#SSLBio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.SSLBio" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.BIO.BIO" title="M2Crypto.BIO.BIO"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.BIO.BIO</span></code></a></p> -<p>Object interface to BIO_f_ssl.</p> -<dl class="method"> -<dt id="M2Crypto.BIO.SSLBio.do_handshake"> -<code class="descname">do_handshake</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#SSLBio.do_handshake"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.SSLBio.do_handshake" title="Permalink to this definition">¶</a></dt> -<dd><p>Do the handshake.</p> -<p>Return 1 if the handshake completes -Return 0 or a negative number if there is a problem</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.BIO.SSLBio.set_ssl"> -<code class="descname">set_ssl</code><span class="sig-paren">(</span><em>conn</em>, <em>close_flag=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#SSLBio.set_ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.SSLBio.set_ssl" title="Permalink to this definition">¶</a></dt> -<dd><p>Sets the bio to the SSL pointer which is -contained in the connection object.</p> -</dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.BIO.openfile"> -<code class="descclassname">M2Crypto.BIO.</code><code class="descname">openfile</code><span class="sig-paren">(</span><em>filename</em>, <em>mode='rb'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BIO.html#openfile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BIO.openfile" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - +<div class="section" id="asn1-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">ASN1</span></code> Module<a class="headerlink" href="#asn1-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.BN"> -<span id="bn-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">BN</span></code> Module<a class="headerlink" href="#module-M2Crypto.BN" title="Permalink to this headline">¶</a></h2> -<dl class="function"> -<dt id="M2Crypto.BN.rand"> -<code class="descclassname">M2Crypto.BN.</code><code class="descname">rand</code><span class="sig-paren">(</span><em>bits</em>, <em>top=-1</em>, <em>bottom=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BN.html#rand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BN.rand" title="Permalink to this definition">¶</a></dt> -<dd><p>Generate cryptographically strong random number.</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>bits</strong> – Length of random number in bits.</li> -<li><strong>top</strong> – If -1, the most significant bit can be 0. If 0, the most -significant bit is 1, and if 1, the two most significant -bits will be 1.</li> -<li><strong>bottom</strong> – If bottom is true, the number will be odd.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.BN.rand_range"> -<code class="descclassname">M2Crypto.BN.</code><code class="descname">rand_range</code><span class="sig-paren">(</span><em>range</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BN.html#rand_range"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BN.rand_range" title="Permalink to this definition">¶</a></dt> -<dd><p>Generate a random number in a range.</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>range</strong> – Upper limit for range.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A random number in the range [0, range)</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.BN.randfname"> -<code class="descclassname">M2Crypto.BN.</code><code class="descname">randfname</code><span class="sig-paren">(</span><em>length</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/BN.html#randfname"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.BN.randfname" title="Permalink to this definition">¶</a></dt> -<dd><p>Return a random filename, which is simply a string where all -the characters are from the set [a-zA-Z0-9].</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> – Length of filename to return.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">random filename string</td> -</tr> -</tbody> -</table> -</dd></dl> - +<div class="section" id="authcookie-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">AuthCookie</span></code> Module<a class="headerlink" href="#authcookie-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.DH"> -<span id="dh-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">DH</span></code> Module<a class="headerlink" href="#module-M2Crypto.DH" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.DH.DH"> -<em class="property">class </em><code class="descclassname">M2Crypto.DH.</code><code class="descname">DH</code><span class="sig-paren">(</span><em>dh</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#DH"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.DH" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>Object interface to the Diffie-Hellman key exchange protocol.</p> -<dl class="method"> -<dt id="M2Crypto.DH.DH.check_params"> -<code class="descname">check_params</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#DH.check_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.DH.check_params" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DH.DH.compute_key"> -<code class="descname">compute_key</code><span class="sig-paren">(</span><em>pubkey</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#DH.compute_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.DH.compute_key" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DH.DH.gen_key"> -<code class="descname">gen_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#DH.gen_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.DH.gen_key" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DH.DH.m2_dh_free"> -<code class="descname">m2_dh_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.DH.DH.m2_dh_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DH.DH.print_params"> -<code class="descname">print_params</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#DH.print_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.DH.print_params" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.DH.DHError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.DH.</code><code class="descname">DHError</code><a class="reference internal" href="_modules/M2Crypto/DH.html#DHError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.DHError" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DH.gen_params"> -<code class="descclassname">M2Crypto.DH.</code><code class="descname">gen_params</code><span class="sig-paren">(</span><em>plen</em>, <em>g</em>, <em>callback=<function genparam_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#gen_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.gen_params" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DH.load_params"> -<code class="descclassname">M2Crypto.DH.</code><code class="descname">load_params</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#load_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.load_params" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DH.load_params_bio"> -<code class="descclassname">M2Crypto.DH.</code><code class="descname">load_params_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#load_params_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.load_params_bio" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DH.set_params"> -<code class="descclassname">M2Crypto.DH.</code><code class="descname">set_params</code><span class="sig-paren">(</span><em>p</em>, <em>g</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DH.html#set_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DH.set_params" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - +<div class="section" id="bio-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">BIO</span></code> Module<a class="headerlink" href="#bio-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.DSA"> -<span id="dsa-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">DSA</span></code> Module<a class="headerlink" href="#module-M2Crypto.DSA" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.DSA.DSA"> -<em class="property">class </em><code class="descclassname">M2Crypto.DSA.</code><code class="descname">DSA</code><span class="sig-paren">(</span><em>dsa</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>This class is a context supporting DSA key and parameter -values, signing and verifying.</p> -<p>Simple example:</p> -<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">M2Crypto</span> <span class="k">import</span> <span class="n">EVP</span><span class="p">,</span> <span class="n">DSA</span><span class="p">,</span> <span class="n">util</span> - -<span class="n">message</span> <span class="o">=</span> <span class="s1">'Kilroy was here!'</span> -<span class="n">md</span> <span class="o">=</span> <span class="n">EVP</span><span class="o">.</span><span class="n">MessageDigest</span><span class="p">(</span><span class="s1">'sha1'</span><span class="p">)</span> -<span class="n">md</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">message</span><span class="p">)</span> -<span class="n">digest</span> <span class="o">=</span> <span class="n">md</span><span class="o">.</span><span class="n">final</span><span class="p">()</span> - -<span class="n">dsa</span> <span class="o">=</span> <span class="n">DSA</span><span class="o">.</span><span class="n">gen_params</span><span class="p">(</span><span class="mi">1024</span><span class="p">)</span> -<span class="n">dsa</span><span class="o">.</span><span class="n">gen_key</span><span class="p">()</span> -<span class="n">r</span><span class="p">,</span> <span class="n">s</span> <span class="o">=</span> <span class="n">dsa</span><span class="o">.</span><span class="n">sign</span><span class="p">(</span><span class="n">digest</span><span class="p">)</span> -<span class="n">good</span> <span class="o">=</span> <span class="n">dsa</span><span class="o">.</span><span class="n">verify</span><span class="p">(</span><span class="n">digest</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="n">s</span><span class="p">)</span> -<span class="k">if</span> <span class="n">good</span><span class="p">:</span> - <span class="nb">print</span><span class="p">(</span><span class="s1">' ** success **'</span><span class="p">)</span> -<span class="k">else</span><span class="p">:</span> - <span class="nb">print</span><span class="p">(</span><span class="s1">' ** verification failed **'</span><span class="p">)</span> -</pre></div> +<div class="section" id="bn-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">BN</span></code> Module<a class="headerlink" href="#bn-module" title="Permalink to this headline">¶</a></h2> </div> -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.check_key"> -<code class="descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.check_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Check to be sure the DSA object has a valid private 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">Returns:</th><td class="field-body">1 (true) if a valid private key</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.gen_key"> -<code class="descname">gen_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.gen_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.gen_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Generate a key pair.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.m2_dsa_free"> -<code class="descname">m2_dsa_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.DSA.DSA.m2_dsa_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>filename</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.save_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the DSA key pair to 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 simple"> -<li><strong>filename</strong> – Save the DSA key pair to this file.</li> -<li><strong>cipher</strong> – name of symmetric key algorithm and mode -to encrypt the private key.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 (true) if successful</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.save_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save DSA key pair to a BIO object.</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>bio</strong> – Save DSA parameters to this object.</li> -<li><strong>cipher</strong> – name of symmetric key algorithm and mode -to encrypt the private key.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 (true) if successful</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.save_params"> -<code class="descname">save_params</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.save_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.save_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the DSA parameters to 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>filename</strong> – Save the DSA parameters to this file.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 (true) if successful</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.save_params_bio"> -<code class="descname">save_params_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.save_params_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.save_params_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save DSA parameters to a BIO object.</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>bio</strong> – Save DSA parameters to this object.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 (true) if successful</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.save_pub_key"> -<code class="descname">save_pub_key</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.save_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.save_pub_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the DSA public key (with parameters) to 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>filename</strong> – Save DSA public key (with parameters) -to this file.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 (true) if successful</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.save_pub_key_bio"> -<code class="descname">save_pub_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.save_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.save_pub_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save DSA public key (with parameters) to a BIO object.</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>bio</strong> – Save DSA public key (with parameters) -to this object.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 (true) if successful</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.set_params"> -<code class="descname">set_params</code><span class="sig-paren">(</span><em>p</em>, <em>q</em>, <em>g</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.set_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.set_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Set new parameters.</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>p</strong> – MPI binary representation … format that consists of -the number’s length in bytes represented as a 4-byte -big-endian number, and the number itself in big-endian -format, where the most significant bit signals -a negative number (the representation of numbers with -the MSB set is prefixed with null byte).</li> -<li><strong>q</strong> – ditto</li> -<li><strong>g</strong> – ditto</li> -</ul> -</td> -</tr> -</tbody> -</table> -<dl class="docutils"> -<dt>@warning: This does not change the private key, so it may be</dt> -<dd>unsafe to use this method. It is better to use -gen_params function to create a new DSA object.</dd> -</dl> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.sign"> -<code class="descname">sign</code><span class="sig-paren">(</span><em>digest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.sign" title="Permalink to this definition">¶</a></dt> -<dd><p>Sign the digest.</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>digest</strong> – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">DSA signature, a tuple of two values, r and s, -both “byte strings”.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.sign_asn1"> -<code class="descname">sign_asn1</code><span class="sig-paren">(</span><em>digest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.sign_asn1"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.sign_asn1" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.verify"> -<code class="descname">verify</code><span class="sig-paren">(</span><em>digest</em>, <em>r</em>, <em>s</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.verify" title="Permalink to this definition">¶</a></dt> -<dd><p>Verify a newly calculated digest against the signature -values r and s.</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>digest</strong> – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)</li> -<li><strong>r</strong> – r value of the signature, a “byte string”</li> -<li><strong>s</strong> – s value of the signature, a “byte string”</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 (true) if verify succeeded, 0 if failed</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA.verify_asn1"> -<code class="descname">verify_asn1</code><span class="sig-paren">(</span><em>digest</em>, <em>blob</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA.verify_asn1"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA.verify_asn1" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.DSA.DSAError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.DSA.</code><code class="descname">DSAError</code><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSAError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSAError" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.DSA.DSA_pub"> -<em class="property">class </em><code class="descclassname">M2Crypto.DSA.</code><code class="descname">DSA_pub</code><span class="sig-paren">(</span><em>dsa</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA_pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA_pub" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.DSA.DSA" title="M2Crypto.DSA.DSA"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.DSA.DSA</span></code></a></p> -<p>This class is a DSA context that only supports a public key -and verification. It does NOT support a private key or -signing.</p> -<dl class="method"> -<dt id="M2Crypto.DSA.DSA_pub.check_key"> -<code class="descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA_pub.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA_pub.check_key" title="Permalink to this definition">¶</a></dt> -<dd><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">does DSA_pub contain a pub key?</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA_pub.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.DSA.DSA_pub.save_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the DSA public key (with parameters) to 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>filename</strong> – Save DSA public key (with parameters) -to this file.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 (true) if successful</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA_pub.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.DSA.DSA_pub.save_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save DSA public key (with parameters) to a BIO object.</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>bio</strong> – Save DSA public key (with parameters) -to this object.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 (true) if successful</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA_pub.sign"> -<code class="descname">sign</code><span class="sig-paren">(</span><em>*argv</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#DSA_pub.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.DSA_pub.sign" title="Permalink to this definition">¶</a></dt> -<dd><p>Sign the digest.</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>digest</strong> – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">DSA signature, a tuple of two values, r and s, -both “byte strings”.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.DSA.DSA_pub.sign_asn1"> -<code class="descname">sign_asn1</code><span class="sig-paren">(</span><em>*argv</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.DSA.DSA_pub.sign_asn1" title="Permalink to this definition">¶</a></dt> -<dd><p>Sign the digest.</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>digest</strong> – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">DSA signature, a tuple of two values, r and s, -both “byte strings”.</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.gen_params"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">gen_params</code><span class="sig-paren">(</span><em>bits</em>, <em>callback=<function genparam_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#gen_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.gen_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that generates DSA parameters and -instantiates a DSA object from the output.</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>bits</strong> – The length of the prime to be generated. If -‘bits’ < 512, it is set to 512.</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked during parameter generation; it usual -purpose is to provide visual feedback.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.load_key"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">load_key</code><span class="sig-paren">(</span><em>file</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.load_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA object from a -PEM encoded DSA key pair.</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>file</strong> – Names the file (a path) that contains the PEM -representation of the DSA key pair.</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked if the DSA key pair is -passphrase-protected.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.load_key_bio"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">load_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.load_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA object from a -PEM encoded DSA key pair.</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>bio</strong> – Contains the PEM representation of the DSA -key pair.</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked if the DSA key pair is -passphrase-protected.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.load_params"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">load_params</code><span class="sig-paren">(</span><em>file</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#load_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.load_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA object with DSA -parameters from 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 simple"> -<li><strong>file</strong> – Names the file (a path) that contains the PEM -representation of the DSA parameters.</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked if the DSA parameters file is -passphrase-protected.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.load_params_bio"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">load_params_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#load_params_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.load_params_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA object with DSA -parameters from a M2Crypto.BIO object.</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>bio</strong> – Contains the PEM representation of the DSA -parameters.</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked if the DSA parameters file is -passphrase-protected.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.load_pub_key"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">load_pub_key</code><span class="sig-paren">(</span><em>file</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#load_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.load_pub_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA_pub object using -a DSA public key contained in PEM file. The PEM file -must contain the parameters in addition to the public 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>file</strong> – Names the file (a path) that contains the PEM -representation of the DSA public key.</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked should the DSA public key be -passphrase-protected.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA_pub.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.load_pub_key_bio"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">load_pub_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#load_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.load_pub_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA_pub object using -a DSA public key contained in PEM format. The PEM -must contain the parameters in addition to the public 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>bio</strong> – Contains the PEM representation of the DSA -public key (with params).</li> -<li><strong>callback</strong> – A Python callback object that will be -invoked should the DSA public key be -passphrase-protected.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA_pub.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.pub_key_from_params"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">pub_key_from_params</code><span class="sig-paren">(</span><em>p</em>, <em>q</em>, <em>g</em>, <em>pub</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#pub_key_from_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.pub_key_from_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA_pub object using -the parameters and public key specified.</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>p</strong> – value of p</li> -<li><strong>q</strong> – value of q</li> -<li><strong>g</strong> – value of g</li> -<li><strong>pub</strong> – value of the public key</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA_pub.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.DSA.set_params"> -<code class="descclassname">M2Crypto.DSA.</code><code class="descname">set_params</code><span class="sig-paren">(</span><em>p</em>, <em>q</em>, <em>g</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/DSA.html#set_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.DSA.set_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a DSA object with DSA -parameters.</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>p</strong> – value of p, a “byte string”</li> -<li><strong>q</strong> – value of q, a “byte string”</li> -<li><strong>g</strong> – value of g, a “byte string”</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">instance of DSA.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - +<div class="section" id="dh-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">DH</span></code> Module<a class="headerlink" href="#dh-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.EC"> -<span id="ec-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">EC</span></code> Module<a class="headerlink" href="#module-M2Crypto.EC" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.EC.EC"> -<em class="property">class </em><code class="descclassname">M2Crypto.EC.</code><code class="descname">EC</code><span class="sig-paren">(</span><em>ec</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>Object interface to a EC key pair.</p> -<dl class="method"> -<dt id="M2Crypto.EC.EC.as_pem"> -<code class="descname">as_pem</code><span class="sig-paren">(</span><em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.as_pem" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the key(pair) as a string in PEM format. -If no password is passed and the cipher is set -it exits with error</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.check_key"> -<code class="descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.check_key" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.compute_dh_key"> -<code class="descname">compute_dh_key</code><span class="sig-paren">(</span><em>pub_key</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.compute_dh_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.compute_dh_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Compute the ECDH shared key of this key pair and the given public -key object. They must both use the same curve. Returns the -shared key in binary as a buffer object. No Key Derivation Function is -applied.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.gen_key"> -<code class="descname">gen_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.gen_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.gen_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Generates the key pair from its parameters. Use:</p> -<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">keypair</span> <span class="o">=</span> <span class="n">EC</span><span class="o">.</span><span class="n">gen_params</span><span class="p">(</span><span class="n">curve</span><span class="p">)</span> -<span class="n">keypair</span><span class="o">.</span><span class="n">gen_key</span><span class="p">()</span> -</pre></div> +<div class="section" id="dsa-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">DSA</span></code> Module<a class="headerlink" href="#dsa-module" title="Permalink to this headline">¶</a></h2> </div> -<p>to create an EC key pair.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.m2_ec_key_free"> -<code class="descname">m2_ec_key_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EC.EC.m2_ec_key_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.pub"> -<code class="descname">pub</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.pub" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>file</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.save_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the key pair to a file in PEM format.</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> – Name of filename to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default -cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.save_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the key pair to an M2Crypto.BIO.BIO object in PEM format.</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>bio</strong> – M2Crypto.BIO.BIO object to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default -cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.save_pub_key"> -<code class="descname">save_pub_key</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.save_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.save_pub_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the public key to a filename in PEM format.</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>file</strong> – Name of filename to save key to.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.save_pub_key_bio"> -<code class="descname">save_pub_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.save_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.save_pub_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the public key to an M2Crypto.BIO.BIO object in PEM format.</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>bio</strong> – M2Crypto.BIO.BIO object to save key to.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.sign_dsa"> -<code class="descname">sign_dsa</code><span class="sig-paren">(</span><em>digest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.sign_dsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.sign_dsa" title="Permalink to this definition">¶</a></dt> -<dd><p>Sign the given digest using ECDSA. Returns a tuple (r,s), the two -ECDSA signature parameters.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.sign_dsa_asn1"> -<code class="descname">sign_dsa_asn1</code><span class="sig-paren">(</span><em>digest</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.sign_dsa_asn1"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.sign_dsa_asn1" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.verify_dsa"> -<code class="descname">verify_dsa</code><span class="sig-paren">(</span><em>digest</em>, <em>r</em>, <em>s</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.verify_dsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.verify_dsa" title="Permalink to this definition">¶</a></dt> -<dd><p>Verify the given digest using ECDSA. r and s are the ECDSA -signature parameters.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC.verify_dsa_asn1"> -<code class="descname">verify_dsa_asn1</code><span class="sig-paren">(</span><em>digest</em>, <em>blob</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC.verify_dsa_asn1"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC.verify_dsa_asn1" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.EC.ECError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.EC.</code><code class="descname">ECError</code><a class="reference internal" href="_modules/M2Crypto/EC.html#ECError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.ECError" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.EC.EC_pub"> -<em class="property">class </em><code class="descclassname">M2Crypto.EC.</code><code class="descname">EC_pub</code><span class="sig-paren">(</span><em>ec</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC_pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC_pub" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.EC.EC" title="M2Crypto.EC.EC"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.EC.EC</span></code></a></p> -<p>Object interface to an EC public key. -((don’t like this implementation inheritance))</p> -<dl class="method"> -<dt id="M2Crypto.EC.EC_pub.get_der"> -<code class="descname">get_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC_pub.get_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC_pub.get_der" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the public key in DER format as a buffer object.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC_pub.get_key"> -<code class="descname">get_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#EC_pub.get_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.EC_pub.get_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Returns the public key as a byte string.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC_pub.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EC.EC_pub.save_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the public key to a filename in PEM format.</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>file</strong> – Name of filename to save key to.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.EC.EC_pub.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EC.EC_pub.save_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Save the public key to an M2Crypto.BIO.BIO object in PEM format.</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>bio</strong> – M2Crypto.BIO.BIO object to save key to.</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.ec_error"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">ec_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#ec_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.ec_error" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.gen_params"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">gen_params</code><span class="sig-paren">(</span><em>curve</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#gen_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.gen_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that generates EC parameters and -instantiates a EC object from the output.</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>curve</strong> – This is the OpenSSL nid of the curve to use.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.get_builtin_curves"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">get_builtin_curves</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#get_builtin_curves"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.get_builtin_curves" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.load_key"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">load_key</code><span class="sig-paren">(</span><em>file</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.load_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a EC object.</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> – Names the filename that contains the PEM representation -of the EC key pair.</li> -<li><strong>callback</strong> – Python callback object that will be invoked -if the EC key pair is passphrase-protected.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.load_key_bio"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">load_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.load_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Factory function that instantiates a EC object.</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>bio</strong> – M2Crypto.BIO object that contains the PEM -representation of the EC key pair.</li> -<li><strong>callback</strong> – Python callback object that will be invoked -if the EC key pair is passphrase-protected.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.load_key_string"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">load_key_string</code><span class="sig-paren">(</span><em>string</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#load_key_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.load_key_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Load an EC key pair from a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing EC key pair in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked -to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EC.EC object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.load_key_string_pubkey"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">load_key_string_pubkey</code><span class="sig-paren">(</span><em>string</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#load_key_string_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.load_key_string_pubkey" title="Permalink to this definition">¶</a></dt> -<dd><p>Load an M2Crypto.EC.PKey from a public key as a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing the key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EC.PKey object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.load_pub_key"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">load_pub_key</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#load_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.load_pub_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Load an EC public key from filename.</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>file</strong> – Name of filename containing EC public key in PEM -format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.EC.EC_pub object.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.load_pub_key_bio"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">load_pub_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#load_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.load_pub_key_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Load an EC public key from an M2Crypto.BIO.BIO object.</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>bio</strong> – M2Crypto.BIO.BIO object containing EC public key in PEM -format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.EC.EC_pub object.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.pub_key_from_der"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">pub_key_from_der</code><span class="sig-paren">(</span><em>der</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#pub_key_from_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.pub_key_from_der" title="Permalink to this definition">¶</a></dt> -<dd><p>Create EC_pub from DER.</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.EC.pub_key_from_params"> -<code class="descclassname">M2Crypto.EC.</code><code class="descname">pub_key_from_params</code><span class="sig-paren">(</span><em>curve</em>, <em>bytes</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EC.html#pub_key_from_params"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EC.pub_key_from_params" title="Permalink to this definition">¶</a></dt> -<dd><p>Create EC_pub from curve name and octet string.</p> -</dd></dl> - +<div class="section" id="ec-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">EC</span></code> Module<a class="headerlink" href="#ec-module" title="Permalink to this headline">¶</a></h2> </div> <div class="section" id="module-M2Crypto.EVP"> <span id="evp-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">EVP</span></code> Module<a class="headerlink" href="#module-M2Crypto.EVP" title="Permalink to this headline">¶</a></h2> -<dl class="class"> +<dl class="py class"> <dt id="M2Crypto.EVP.Cipher"> -<em class="property">class </em><code class="descclassname">M2Crypto.EVP.</code><code class="descname">Cipher</code><span class="sig-paren">(</span><em>alg</em>, <em>key</em>, <em>iv</em>, <em>op</em>, <em>key_as_bytes=0</em>, <em>d='md5'</em>, <em>salt=b'12345678'</em>, <em>i=1</em>, <em>padding=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher" title="Permalink to this definition">¶</a></dt> +<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">Cipher</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">alg</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">iv</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">op</span><span class="p">:</span> <span class="n">object</span></em>, <em class="sig-param"><span class="n">key_as_bytes</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">0</span></em>, <em class="sig-param"><span class="n">d</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'md5'</span></em>, <em class="sig-param"><span class="n">salt</span><span class="p">:</span> <span class="n">bytes</span> <span class="o">=</span> <span class="default_value">b'12345678'</span></em>, <em class="sig-param"><span class="n">i</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em>, <em class="sig-param"><span class="n">padding</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.Cipher.final"> -<code class="descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher.final" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher.final" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.Cipher.m2_cipher_ctx_free"> -<code class="descname">m2_cipher_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.Cipher.m2_cipher_ctx_free" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">m2_cipher_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.Cipher.m2_cipher_ctx_free" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.Cipher.set_padding"> -<code class="descname">set_padding</code><span class="sig-paren">(</span><em>padding=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher.set_padding"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher.set_padding" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">set_padding</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">padding</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher.set_padding"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher.set_padding" title="Permalink to this definition">¶</a></dt> <dd><p>Actually always return 1</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.Cipher.update"> -<code class="descname">update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher.update" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#Cipher.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.Cipher.update" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> -<dl class="exception"> +<dl class="py exception"> <dt id="M2Crypto.EVP.EVPError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.EVP.</code><code class="descname">EVPError</code><a class="reference internal" href="_modules/M2Crypto/EVP.html#EVPError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.EVPError" title="Permalink to this definition">¶</a></dt> +<em class="property">exception </em><code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">EVPError</code><a class="reference internal" href="_modules/M2Crypto/EVP.html#EVPError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.EVPError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ValueError</span></code></p> </dd></dl> -<dl class="class"> +<dl class="py class"> <dt id="M2Crypto.EVP.HMAC"> -<em class="property">class </em><code class="descclassname">M2Crypto.EVP.</code><code class="descname">HMAC</code><span class="sig-paren">(</span><em>key</em>, <em>algo='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC" title="Permalink to this definition">¶</a></dt> +<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">HMAC</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.HMAC.digest"> -<code class="descname">digest</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.HMAC.digest" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">digest</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="headerlink" href="#M2Crypto.EVP.HMAC.digest" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.HMAC.final"> -<code class="descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC.final" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC.final" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.HMAC.m2_hmac_ctx_free"> -<code class="descname">m2_hmac_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.HMAC.m2_hmac_ctx_free" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">m2_hmac_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.HMAC.m2_hmac_ctx_free" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.HMAC.reset"> -<code class="descname">reset</code><span class="sig-paren">(</span><em>key</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC.reset" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC.reset" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.HMAC.update"> -<code class="descname">update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC.update" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#HMAC.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.HMAC.update" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </dd></dl> -<dl class="class"> +<dl class="py class"> <dt id="M2Crypto.EVP.MessageDigest"> -<em class="property">class </em><code class="descclassname">M2Crypto.EVP.</code><code class="descname">MessageDigest</code><span class="sig-paren">(</span><em>algo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#MessageDigest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.MessageDigest" title="Permalink to this definition">¶</a></dt> +<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">MessageDigest</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#MessageDigest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.MessageDigest" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> <p>Message Digest</p> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.MessageDigest.digest"> -<code class="descname">digest</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.digest" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">digest</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.digest" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.MessageDigest.final"> -<code class="descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#MessageDigest.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.final" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#MessageDigest.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.final" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.MessageDigest.m2_md_ctx_free"> -<code class="descname">m2_md_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.m2_md_ctx_free" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">m2_md_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.m2_md_ctx_free" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.MessageDigest.update"> -<code class="descname">update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#MessageDigest.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.update" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#MessageDigest.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.MessageDigest.update" title="Permalink to this definition">¶</a></dt> <dd><p>Add data to be digested.</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">-1 for Python error, 1 for success, 0 for OpenSSL failure.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>-1 for Python error, 1 for success, 0 for OpenSSL failure.</p> +</dd> +</dl> </dd></dl> </dd></dl> -<dl class="class"> +<dl class="py class"> <dt id="M2Crypto.EVP.PKey"> -<em class="property">class </em><code class="descclassname">M2Crypto.EVP.</code><code class="descname">PKey</code><span class="sig-paren">(</span><em>pkey=None</em>, <em>_pyfree=0</em>, <em>md='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey" title="Permalink to this definition">¶</a></dt> +<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">PKey</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pkey</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>bytes<span class="p">]</span></span> <span class="o">=</span> <span class="default_value">None</span></em>, <em class="sig-param"><span class="n">_pyfree</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">0</span></em>, <em class="sig-param"><span class="n">md</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> <p>Public Key</p> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.as_der"> -<code class="descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.as_der" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.as_der" title="Permalink to this definition">¶</a></dt> <dd><p>Return key in DER format in a string</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.as_pem"> -<code class="descname">as_pem</code><span class="sig-paren">(</span><em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.as_pem" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">as_pem</code><span class="sig-paren">(</span><em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.as_pem" title="Permalink to this definition">¶</a></dt> <dd><p>Return key in PEM format in a 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"><ul class="first last simple"> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>cipher</strong> – Symmetric cipher to protect the key. The default cipher is <code class="docutils literal notranslate"><span class="pre">'aes_128_cbc'</span></code>. If cipher is None, -then the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +then the key is saved in the clear.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is -util.passphrase_callback.</li> +util.passphrase_callback.</p></li> </ul> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.assign_rsa"> -<code class="descname">assign_rsa</code><span class="sig-paren">(</span><em>rsa</em>, <em>capture=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.assign_rsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.assign_rsa" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">assign_rsa</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rsa</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA">M2Crypto.RSA.RSA</a></span></em>, <em class="sig-param"><span class="n">capture</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">1</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.assign_rsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.assign_rsa" title="Permalink to this definition">¶</a></dt> <dd><p>Assign the RSA key pair to self.</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>rsa</strong> – M2Crypto.RSA.RSA object to be assigned to self.</li> -<li><strong>capture</strong> – If true (default), this PKey object will own the RSA +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>rsa</strong> – M2Crypto.RSA.RSA object to be assigned to self.</p></li> +<li><p><strong>capture</strong> – If true (default), this PKey object will own the RSA object, meaning that once the PKey object gets -deleted it is no longer safe to use the RSA object.</li> +deleted it is no longer safe to use the RSA object.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Return 1 for success and 0 for failure.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Return 1 for success and 0 for failure.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_sign"> +<code class="sig-name descname">digest_sign</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_sign" title="Permalink to this definition">¶</a></dt> +<dd><p>Return signature.</p> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>The signature.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_sign_final"> +<code class="sig-name descname">digest_sign_final</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_sign_final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_sign_final" title="Permalink to this definition">¶</a></dt> +<dd><p>Return signature.</p> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>The signature.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_sign_init"> +<code class="sig-name descname">digest_sign_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_sign_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_sign_init" title="Permalink to this definition">¶</a></dt> +<dd><p>Initialise digest signing operation with self.</p> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_sign_update"> +<code class="sig-name descname">digest_sign_update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_sign_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_sign_update" title="Permalink to this definition">¶</a></dt> +<dd><p>Feed data to digest signing operation.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>data</strong> – Data to be signed.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_verify"> +<code class="sig-name descname">digest_verify</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_verify" title="Permalink to this definition">¶</a></dt> +<dd><p>Return result of verification.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>sign</strong> – Signature to use for verification</p></li> +<li><p><strong>data</strong> – Data to be verified.</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Result of verification: 1 for success, 0 for failure, -1 on +other error.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_verify_final"> +<code class="sig-name descname">digest_verify_final</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sign</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_verify_final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_verify_final" title="Permalink to this definition">¶</a></dt> +<dd><p>Feed data to digest verification operation.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>sign</strong> – Signature to use for verification</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Result of verification: 1 for success, 0 for failure, -1 on +other error.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_verify_init"> +<code class="sig-name descname">digest_verify_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_verify_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_verify_init" title="Permalink to this definition">¶</a></dt> +<dd><p>Initialise verification operation with self.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> +<dt id="M2Crypto.EVP.PKey.digest_verify_update"> +<code class="sig-name descname">digest_verify_update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.digest_verify_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.digest_verify_update" title="Permalink to this definition">¶</a></dt> +<dd><p>Feed data to verification operation.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>data</strong> – Data to be verified.</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>-1 on Python error, 1 for success, 0 for OpenSSL error</p> +</dd> +</dl> +</dd></dl> + +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.final"> -<code class="descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.PKey.final" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="headerlink" href="#M2Crypto.EVP.PKey.final" title="Permalink to this definition">¶</a></dt> <dd><p>Return signature.</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">The signature.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>The signature.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.get_modulus"> -<code class="descname">get_modulus</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.get_modulus"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.get_modulus" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">get_modulus</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Optional<span class="p">[</span>bytes<span class="p">]</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.get_modulus"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.get_modulus" title="Permalink to this definition">¶</a></dt> <dd><p>Return the modulus in hex format.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.get_rsa"> -<code class="descname">get_rsa</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.get_rsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.get_rsa" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">get_rsa</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA_pub" title="M2Crypto.RSA.RSA_pub">M2Crypto.RSA.RSA_pub</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.get_rsa"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.get_rsa" title="Permalink to this definition">¶</a></dt> <dd><p>Return the underlying RSA key if that is what the EVP instance is holding.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.m2_md_ctx_free"> -<code class="descname">m2_md_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.PKey.m2_md_ctx_free" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">m2_md_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.PKey.m2_md_ctx_free" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.m2_pkey_free"> -<code class="descname">m2_pkey_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.PKey.m2_pkey_free" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">m2_pkey_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.PKey.m2_pkey_free" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.reset_context"> -<code class="descname">reset_context</code><span class="sig-paren">(</span><em>md='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.reset_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.reset_context" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">reset_context</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">md</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.reset_context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.reset_context" title="Permalink to this definition">¶</a></dt> <dd><p>Reset internal message digest context.</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>md</strong> – The message digest algorithm.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>md</strong> – The message digest algorithm.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>file</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.save_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key</code><span class="sig-paren">(</span><em class="sig-param">file: AnyStr</em>, <em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.save_key" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to a file in PEM format.</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> – Name of file to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>file</strong> – Name of file to save key to.</p></li> +<li><p><strong>cipher</strong> – Symmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +the key is saved in the clear.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is -util.passphrase_callback.</li> +util.passphrase_callback.</p></li> </ul> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.save_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key_bio</code><span class="sig-paren">(</span><em class="sig-param">bio: BIO.BIO</em>, <em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.save_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to the M2Crypto.BIO object ‘bio’ in PEM format.</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>bio</strong> – M2Crypto.BIO object to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>bio</strong> – M2Crypto.BIO object to save key to.</p></li> +<li><p><strong>cipher</strong> – Symmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +the key is saved in the clear.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is -util.passphrase_callback.</li> +util.passphrase_callback.</p></li> </ul> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.sign_final"> -<code class="descname">sign_final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.sign_final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.sign_final" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">sign_final</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.sign_final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.sign_final" title="Permalink to this definition">¶</a></dt> <dd><p>Return signature.</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">The signature.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>The signature.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.sign_init"> -<code class="descname">sign_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.sign_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.sign_init" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">sign_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.sign_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.sign_init" title="Permalink to this definition">¶</a></dt> <dd><p>Initialise signing operation with self.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.sign_update"> -<code class="descname">sign_update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.sign_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.sign_update" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">sign_update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.sign_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.sign_update" title="Permalink to this definition">¶</a></dt> <dd><p>Feed data to signing operation.</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>data</strong> – Data to be signed.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>data</strong> – Data to be signed.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.size"> -<code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.size" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.size" title="Permalink to this definition">¶</a></dt> <dd><p>Return the size of the key in bytes.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.update"> -<code class="descname">update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.EVP.PKey.update" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → None<a class="headerlink" href="#M2Crypto.EVP.PKey.update" title="Permalink to this definition">¶</a></dt> <dd><p>Feed data to signing operation.</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>data</strong> – Data to be signed.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>data</strong> – Data to be signed.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.verify_final"> -<code class="descname">verify_final</code><span class="sig-paren">(</span><em>sign</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.verify_final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.verify_final" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">verify_final</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sign</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.verify_final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.verify_final" title="Permalink to this definition">¶</a></dt> <dd><p>Return result of verification.</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>sign</strong> – Signature to use for verification</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Result of verification: 1 for success, 0 for failure, -1 on -other error.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>sign</strong> – Signature to use for verification</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Result of verification: 1 for success, 0 for failure, -1 on +other error.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.verify_init"> -<code class="descname">verify_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.verify_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.verify_init" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">verify_init</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.verify_init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.verify_init" title="Permalink to this definition">¶</a></dt> <dd><p>Initialise signature verification operation with self.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.EVP.PKey.verify_update"> -<code class="descname">verify_update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.verify_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.verify_update" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">verify_update</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/EVP.html#PKey.verify_update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.PKey.verify_update" title="Permalink to this definition">¶</a></dt> <dd><p>Feed data to verification operation.</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>data</strong> – Data to be verified.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">-1 on Python error, 1 for success, 0 for OpenSSL error</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>data</strong> – Data to be verified.</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>-1 on Python error, 1 for success, 0 for OpenSSL error</p> +</dd> +</dl> </dd></dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.hmac"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">hmac</code><span class="sig-paren">(</span><em>key</em>, <em>data</em>, <em>algo='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#hmac"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.hmac" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">hmac</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#hmac"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.hmac" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.load_key"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">load_key</code><span class="sig-paren">(</span><em>file</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">load_key</code><span class="sig-paren">(</span><em class="sig-param">file: AnyStr</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.EVP.PKey" title="M2Crypto.EVP.PKey">M2Crypto.EVP.PKey</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key" title="Permalink to this definition">¶</a></dt> <dd><p>Load an M2Crypto.EVP.PKey from 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 simple"> -<li><strong>file</strong> – Name of file containing the key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>file</strong> – Name of file containing the key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the -key.</li> +key.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EVP.PKey object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.EVP.PKey object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.load_key_bio"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">load_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">load_key_bio</code><span class="sig-paren">(</span><em class="sig-param">bio: BIO.BIO</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.EVP.PKey" title="M2Crypto.EVP.PKey">PKey</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.</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>bio</strong> – M2Crypto.BIO object containing the key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>bio</strong> – M2Crypto.BIO object containing the key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the -key.</li> +key.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EVP.PKey object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.EVP.PKey object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.load_key_bio_pubkey"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">load_key_bio_pubkey</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_bio_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_bio_pubkey" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">load_key_bio_pubkey</code><span class="sig-paren">(</span><em class="sig-param">bio: BIO.BIO</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.EVP.PKey" title="M2Crypto.EVP.PKey">PKey</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_bio_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_bio_pubkey" title="Permalink to this definition">¶</a></dt> <dd><p>Load an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object.</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>bio</strong> – M2Crypto.BIO object containing the key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>bio</strong> – M2Crypto.BIO object containing the key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.EVP.PKey object.</p> +</dd> +</dl> +</dd></dl> + +<dl class="py function"> +<dt id="M2Crypto.EVP.load_key_pubkey"> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">load_key_pubkey</code><span class="sig-paren">(</span><em class="sig-param">file: AnyStr</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.EVP.PKey" title="M2Crypto.EVP.PKey">M2Crypto.EVP.PKey</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_pubkey" title="Permalink to this definition">¶</a></dt> +<dd><p>Load an M2Crypto.EVP.PKey from a public key as a file.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>file</strong> – Name of file containing the key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the -key.</li> +key.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EVP.PKey object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.EVP.PKey object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.load_key_string"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">load_key_string</code><span class="sig-paren">(</span><em>string</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_string" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">load_key_string</code><span class="sig-paren">(</span><em class="sig-param">string: AnyStr</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.EVP.PKey" title="M2Crypto.EVP.PKey">M2Crypto.EVP.PKey</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_string" title="Permalink to this definition">¶</a></dt> <dd><p>Load an M2Crypto.EVP.PKey from a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing the key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>string</strong> – String containing the key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the -key.</li> +key.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EVP.PKey object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.EVP.PKey object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.load_key_string_pubkey"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">load_key_string_pubkey</code><span class="sig-paren">(</span><em>string</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_string_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_string_pubkey" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">load_key_string_pubkey</code><span class="sig-paren">(</span><em class="sig-param">string: AnyStr</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.EVP.PKey" title="M2Crypto.EVP.PKey">M2Crypto.EVP.PKey</a><a class="reference internal" href="_modules/M2Crypto/EVP.html#load_key_string_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.load_key_string_pubkey" title="Permalink to this definition">¶</a></dt> <dd><p>Load an M2Crypto.EVP.PKey from a public key as a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing the key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>string</strong> – String containing the key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the -key.</li> +key.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.EVP.PKey object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.EVP.PKey object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.EVP.pbkdf2"> -<code class="descclassname">M2Crypto.EVP.</code><code class="descname">pbkdf2</code><span class="sig-paren">(</span><em>password</em>, <em>salt</em>, <em>iter</em>, <em>keylen</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/EVP.html#pbkdf2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.pbkdf2" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.EVP.</code><code class="sig-name descname">pbkdf2</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">password</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">salt</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">iter</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">keylen</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/EVP.html#pbkdf2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.EVP.pbkdf2" title="Permalink to this definition">¶</a></dt> <dd><p>Derive a key from password using PBKDF2 algorithm specified in RFC 2898.</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>password</strong> – Derive the key from this password.</li> -<li><strong>salt</strong> – Salt.</li> -<li><strong>iter</strong> – Number of iterations to perform.</li> -<li><strong>keylen</strong> – Length of key to produce.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Key.</p> -</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>password</strong> – Derive the key from this password.</p></li> +<li><p><strong>salt</strong> – Salt.</p></li> +<li><p><strong>iter</strong> – Number of iterations to perform.</p></li> +<li><p><strong>keylen</strong> – Length of key to produce.</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>Key.</p> +</dd> +</dl> </dd></dl> </div> -<div class="section" id="module-M2Crypto.Engine"> -<span id="engine-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Engine</span></code> Module<a class="headerlink" href="#module-M2Crypto.Engine" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.Engine.Engine"> -<em class="property">class </em><code class="descclassname">M2Crypto.Engine.</code><code class="descname">Engine</code><span class="sig-paren">(</span><em>id=None</em>, <em>_ptr=None</em>, <em>_pyfree=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>Wrapper for ENGINE object.</p> -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.ctrl_cmd_string"> -<code class="descname">ctrl_cmd_string</code><span class="sig-paren">(</span><em>cmd</em>, <em>arg</em>, <em>optional=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.ctrl_cmd_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.ctrl_cmd_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Call ENGINE_ctrl_cmd_string</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.finish"> -<code class="descname">finish</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.finish"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.finish" title="Permalink to this definition">¶</a></dt> -<dd><p>Release a functional and structural reference to the engine.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.get_id"> -<code class="descname">get_id</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.get_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.get_id" title="Permalink to this definition">¶</a></dt> -<dd><p>Return engine id</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.get_name"> -<code class="descname">get_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.get_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.get_name" title="Permalink to this definition">¶</a></dt> -<dd><p>Return engine name</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.init"> -<code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.init" title="Permalink to this definition">¶</a></dt> -<dd><p>Obtain a functional reference to the engine.</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">0 on error, non-zero on success.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.load_certificate"> -<code class="descname">load_certificate</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.load_certificate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.load_certificate" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate from engine (e.g from smartcard). -NOTE: This function may be not implemented by engine!</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.load_private_key"> -<code class="descname">load_private_key</code><span class="sig-paren">(</span><em>name</em>, <em>pin=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.load_private_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.load_private_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Load private key with engine methods (e.g from smartcard). -If pin is not set it will be asked</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.load_public_key"> -<code class="descname">load_public_key</code><span class="sig-paren">(</span><em>name</em>, <em>pin=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.load_public_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.load_public_key" title="Permalink to this definition">¶</a></dt> -<dd><p>Load public key with engine methods (e.g from smartcard).</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.m2_engine_free"> -<code class="descname">m2_engine_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.Engine.Engine.m2_engine_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.Engine.Engine.set_default"> -<code class="descname">set_default</code><span class="sig-paren">(</span><em>methods=65535</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#Engine.set_default"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.Engine.set_default" title="Permalink to this definition">¶</a></dt> -<dd><p>Use this engine as default for methods specified in argument</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>methods</strong> – Possible values are bitwise OR of m2.ENGINE_METHOD_*</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.Engine.EngineError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.Engine.</code><code class="descname">EngineError</code><a class="reference internal" href="_modules/M2Crypto/Engine.html#EngineError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.EngineError" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Engine.cleanup"> -<code class="descclassname">M2Crypto.Engine.</code><code class="descname">cleanup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.cleanup" title="Permalink to this definition">¶</a></dt> -<dd><p>If you load any engines, you need to clean up after your application -is finished with the engines.</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Engine.load_dynamic"> -<code class="descclassname">M2Crypto.Engine.</code><code class="descname">load_dynamic</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#load_dynamic"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.load_dynamic" title="Permalink to this definition">¶</a></dt> -<dd><p>Load dynamic engine</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Engine.load_dynamic_engine"> -<code class="descclassname">M2Crypto.Engine.</code><code class="descname">load_dynamic_engine</code><span class="sig-paren">(</span><em>id</em>, <em>sopath</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#load_dynamic_engine"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.load_dynamic_engine" title="Permalink to this definition">¶</a></dt> -<dd><p>Load and return dymanic engine from sopath and assign id to it</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Engine.load_openssl"> -<code class="descclassname">M2Crypto.Engine.</code><code class="descname">load_openssl</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Engine.html#load_openssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Engine.load_openssl" title="Permalink to this definition">¶</a></dt> -<dd><p>Load openssl engine</p> -</dd></dl> - +<div class="section" id="engine-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Engine</span></code> Module<a class="headerlink" href="#engine-module" title="Permalink to this headline">¶</a></h2> </div> <div class="section" id="module-M2Crypto.Err"> <span id="err-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Err</span></code> Module<a class="headerlink" href="#module-M2Crypto.Err" title="Permalink to this headline">¶</a></h2> -<dl class="exception"> +<dl class="py exception"> <dt id="M2Crypto.Err.M2CryptoError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.Err.</code><code class="descname">M2CryptoError</code><a class="reference internal" href="_modules/M2Crypto/Err.html#M2CryptoError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.M2CryptoError" title="Permalink to this definition">¶</a></dt> +<em class="property">exception </em><code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">M2CryptoError</code><a class="reference internal" href="_modules/M2Crypto/Err.html#M2CryptoError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.M2CryptoError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> </dd></dl> -<dl class="exception"> +<dl class="py exception"> <dt id="M2Crypto.Err.SSLError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.Err.</code><code class="descname">SSLError</code><span class="sig-paren">(</span><em>err</em>, <em>client_addr</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#SSLError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.SSLError" title="Permalink to this definition">¶</a></dt> +<em class="property">exception </em><code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">SSLError</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">err</span><span class="p">:</span> <span class="n">int</span></em>, <em class="sig-param"><span class="n">client_addr</span><span class="p">:</span> <span class="n">Union<span class="p">[</span>Tuple<span class="p">[</span>str<span class="p">, </span>int<span class="p">]</span><span class="p">, </span>str<span class="p">]</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#SSLError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.SSLError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_error"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Optional<span class="p">[</span>str<span class="p">]</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_error_code"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_error_code</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_code" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_error_code</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_code" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_error_func"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_error_func</code><span class="sig-paren">(</span><em>err</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_func" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_error_func</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">err</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>int<span class="p">]</span></span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_func"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_func" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_error_lib"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_error_lib</code><span class="sig-paren">(</span><em>err</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_lib"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_lib" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_error_lib</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">err</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>int<span class="p">]</span></span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_lib"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_lib" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_error_message"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_error_message</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_message" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_error_message</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_message"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_message" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_error_reason"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_error_reason</code><span class="sig-paren">(</span><em>err</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_reason"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_reason" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_error_reason</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">err</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>int<span class="p">]</span></span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/Err.html#get_error_reason"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_error_reason" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.get_x509_verify_error"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">get_x509_verify_error</code><span class="sig-paren">(</span><em>err</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#get_x509_verify_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_x509_verify_error" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">get_x509_verify_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">err</span><span class="p">:</span> <span class="n">Optional<span class="p">[</span>int<span class="p">]</span></span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/Err.html#get_x509_verify_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.get_x509_verify_error" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.Err.peek_error_code"> -<code class="descclassname">M2Crypto.Err.</code><code class="descname">peek_error_code</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Err.html#peek_error_code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.peek_error_code" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.Err.</code><code class="sig-name descname">peek_error_code</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/Err.html#peek_error_code"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Err.peek_error_code" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </div> -<div class="section" id="module-M2Crypto.RC4"> -<span id="rc4-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">RC4</span></code> Module<a class="headerlink" href="#module-M2Crypto.RC4" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.RC4.RC4"> -<em class="property">class </em><code class="descclassname">M2Crypto.RC4.</code><code class="descname">RC4</code><span class="sig-paren">(</span><em>key=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RC4.html#RC4"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RC4.RC4" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>Object interface to the stream cipher RC4.</p> -<dl class="method"> -<dt id="M2Crypto.RC4.RC4.final"> -<code class="descname">final</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RC4.html#RC4.final"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RC4.RC4.final" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.RC4.RC4.rc4_free"> -<code class="descname">rc4_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.RC4.RC4.rc4_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.RC4.RC4.set_key"> -<code class="descname">set_key</code><span class="sig-paren">(</span><em>key</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RC4.html#RC4.set_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RC4.RC4.set_key" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.RC4.RC4.update"> -<code class="descname">update</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RC4.html#RC4.update"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RC4.RC4.update" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - +<div class="section" id="rc4-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">RC4</span></code> Module<a class="headerlink" href="#rc4-module" title="Permalink to this headline">¶</a></h2> </div> <div class="section" id="module-M2Crypto.RSA"> <span id="rsa-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">RSA</span></code> Module<a class="headerlink" href="#module-M2Crypto.RSA" title="Permalink to this headline">¶</a></h2> -<dl class="class"> +<dl class="py class"> <dt id="M2Crypto.RSA.RSA"> -<em class="property">class </em><code class="descclassname">M2Crypto.RSA.</code><code class="descname">RSA</code><span class="sig-paren">(</span><em>rsa</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA" title="Permalink to this definition">¶</a></dt> +<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">RSA</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rsa</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">_pyfree</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> <p>RSA Key Pair.</p> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.as_pem"> -<code class="descname">as_pem</code><span class="sig-paren">(</span><em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.as_pem" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">as_pem</code><span class="sig-paren">(</span><em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.as_pem" title="Permalink to this definition">¶</a></dt> <dd><p>Returns the key(pair) as a string in PEM format.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.check_key"> -<code class="descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.check_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.check_key" title="Permalink to this definition">¶</a></dt> <dd><p>Validate RSA keys.</p> <p>It checks that p and q are in fact prime, and that n = p*q.</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">returns 1 if rsa is a valid RSA key, and 0 otherwise. +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>returns 1 if rsa is a valid RSA key, and 0 otherwise. -1 is returned if an error occurs while checking the key. If the key is invalid or an error occurred, the reason -code can be obtained using ERR_get_error(3).</td> -</tr> -</tbody> -</table> +code can be obtained using ERR_get_error(3).</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.m2_rsa_free"> -<code class="descname">m2_rsa_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.RSA.RSA.m2_rsa_free" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">m2_rsa_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.RSA.RSA.m2_rsa_free" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.private_decrypt"> -<code class="descname">private_decrypt</code><span class="sig-paren">(</span><em>data</em>, <em>padding</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.private_decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.private_decrypt" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">private_decrypt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">padding</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.private_decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.private_decrypt" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.private_encrypt"> -<code class="descname">private_encrypt</code><span class="sig-paren">(</span><em>data</em>, <em>padding</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.private_encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.private_encrypt" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">private_encrypt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">padding</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.private_encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.private_encrypt" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.pub"> -<code class="descname">pub</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.pub" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">pub</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → Tuple<span class="p">[</span>bytes<span class="p">, </span>bytes<span class="p">]</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.pub" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.public_decrypt"> -<code class="descname">public_decrypt</code><span class="sig-paren">(</span><em>data</em>, <em>padding</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.public_decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.public_decrypt" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">public_decrypt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">padding</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.public_decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.public_decrypt" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.public_encrypt"> -<code class="descname">public_encrypt</code><span class="sig-paren">(</span><em>data</em>, <em>padding</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.public_encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.public_encrypt" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">public_encrypt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">padding</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.public_encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.public_encrypt" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>file</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key</code><span class="sig-paren">(</span><em class="sig-param">file: AnyStr</em>, <em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to a file in PEM format.</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> – Name of file to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>file</strong> – Name of file to save key to.</p></li> +<li><p><strong>cipher</strong> – Symmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +the key is saved in the clear.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is -util.passphrase_callback.</li> +util.passphrase_callback.</p></li> </ul> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key_bio</code><span class="sig-paren">(</span><em class="sig-param">bio: BIO.BIO</em>, <em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to an M2Crypto.BIO.BIO object in PEM format.</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>bio</strong> – M2Crypto.BIO.BIO object to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>bio</strong> – M2Crypto.BIO.BIO object to save key to.</p></li> +<li><p><strong>cipher</strong> – Symmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +the key is saved in the clear.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is -util.passphrase_callback.</li> +util.passphrase_callback.</p></li> </ul> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_key_der"> -<code class="descname">save_key_der</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key_der" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key_der</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key_der" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to a file in DER format.</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>file</strong> – Filename to save key to</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>file</strong> – Filename to save key to</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_key_der_bio"> -<code class="descname">save_key_der_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key_der_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key_der_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key_der_bio</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bio</span><span class="p">:</span> <span class="n">BIO.BIO</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_key_der_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_key_der_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to an M2Crypto.BIO.BIO object in DER format.</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>bio</strong> – M2Crypto.BIO.BIO object to save key to.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>bio</strong> – M2Crypto.BIO.BIO object to save key to.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_pem"> -<code class="descname">save_pem</code><span class="sig-paren">(</span><em>file</em>, <em>cipher='aes_128_cbc'</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.RSA.RSA.save_pem" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_pem</code><span class="sig-paren">(</span><em class="sig-param">file: AnyStr</em>, <em class="sig-param">cipher: Optional[str] = 'aes_128_cbc'</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → int<a class="headerlink" href="#M2Crypto.RSA.RSA.save_pem" title="Permalink to this definition">¶</a></dt> <dd><p>Save the key pair to a file in PEM format.</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> – Name of file to save key to.</li> -<li><strong>cipher</strong> – Symmetric cipher to protect the key. The default +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>file</strong> – Name of file to save key to.</p></li> +<li><p><strong>cipher</strong> – Symmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then -the key is saved in the clear.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +the key is saved in the clear.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is -util.passphrase_callback.</li> +util.passphrase_callback.</p></li> </ul> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_pub_key"> -<code class="descname">save_pub_key</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_pub_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_pub_key</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_pub_key" title="Permalink to this definition">¶</a></dt> <dd><p>Save the public key to a file in PEM format.</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>file</strong> – Name of file to save key to.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>file</strong> – Name of file to save key to.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.save_pub_key_bio"> -<code class="descname">save_pub_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_pub_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_pub_key_bio</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bio</span><span class="p">:</span> <span class="n">BIO.BIO</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.save_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.save_pub_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Save the public key to an M2Crypto.BIO.BIO object in PEM format.</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>bio</strong> – M2Crypto.BIO.BIO object to save key to.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>bio</strong> – M2Crypto.BIO.BIO object to save key to.</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.sign"> -<code class="descname">sign</code><span class="sig-paren">(</span><em>digest</em>, <em>algo='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.sign" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">sign</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">digest</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.sign" title="Permalink to this definition">¶</a></dt> <dd><p>Signs a digest with the private 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>digest</strong> – A digest created by using the digest method</li> -<li><strong>algo</strong> – The method that created the digest. +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>digest</strong> – A digest created by using the digest method</p></li> +<li><p><strong>algo</strong> – The method that created the digest. Legal values like ‘sha1’,’sha224’, ‘sha256’, -‘ripemd160’, and ‘md5’.</li> +‘ripemd160’, and ‘md5’.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a string which is the signature</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>a string which is the signature</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.sign_rsassa_pss"> -<code class="descname">sign_rsassa_pss</code><span class="sig-paren">(</span><em>digest</em>, <em>algo='sha1'</em>, <em>salt_length=20</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.sign_rsassa_pss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.sign_rsassa_pss" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">sign_rsassa_pss</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">digest</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em>, <em class="sig-param"><span class="n">salt_length</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">20</span></em><span class="sig-paren">)</span> → bytes<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.sign_rsassa_pss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.sign_rsassa_pss" title="Permalink to this definition">¶</a></dt> <dd><p>Signs a digest with the private key using RSASSA-PSS</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>digest</strong> – A digest created by using the digest method</li> -<li><strong>salt_length</strong> – The length of the salt to use</li> -<li><strong>algo</strong> – The hash algorithm to use +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>digest</strong> – A digest created by using the digest method</p></li> +<li><p><strong>salt_length</strong> – The length of the salt to use</p></li> +<li><p><strong>algo</strong> – The hash algorithm to use Legal values like ‘sha1’,’sha224’, ‘sha256’, -‘ripemd160’, and ‘md5’.</li> +‘ripemd160’, and ‘md5’.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a string which is the signature</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>a string which is the signature</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.verify"> -<code class="descname">verify</code><span class="sig-paren">(</span><em>data</em>, <em>signature</em>, <em>algo='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.verify" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">verify</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">signature</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.verify" title="Permalink to this definition">¶</a></dt> <dd><p>Verifies the signature with the public 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>data</strong> – Data that has been signed</li> -<li><strong>signature</strong> – The signature signed with the private key</li> -<li><strong>algo</strong> – The method use to create digest from the data +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>data</strong> – Data that has been signed</p></li> +<li><p><strong>signature</strong> – The signature signed with the private key</p></li> +<li><p><strong>algo</strong> – The method use to create digest from the data before it was signed. Legal values like -‘sha1’,’sha224’, ‘sha256’, ‘ripemd160’, and ‘md5’.</li> +‘sha1’,’sha224’, ‘sha256’, ‘ripemd160’, and ‘md5’.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 or 0, depending on whether the signature was +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>1 or 0, depending on whether the signature was verified or not.</p> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA.verify_rsassa_pss"> -<code class="descname">verify_rsassa_pss</code><span class="sig-paren">(</span><em>data</em>, <em>signature</em>, <em>algo='sha1'</em>, <em>salt_length=20</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.verify_rsassa_pss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.verify_rsassa_pss" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">verify_rsassa_pss</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">signature</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">algo</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'sha1'</span></em>, <em class="sig-param"><span class="n">salt_length</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">20</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA.verify_rsassa_pss"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA.verify_rsassa_pss" title="Permalink to this definition">¶</a></dt> <dd><p>Verifies the signature RSASSA-PSS</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>data</strong> – Data that has been signed</li> -<li><strong>signature</strong> – The signature signed with RSASSA-PSS</li> -<li><strong>salt_length</strong> – The length of the salt that was used</li> -<li><strong>algo</strong> – The hash algorithm to use +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>data</strong> – Data that has been signed</p></li> +<li><p><strong>signature</strong> – The signature signed with RSASSA-PSS</p></li> +<li><p><strong>salt_length</strong> – The length of the salt that was used</p></li> +<li><p><strong>algo</strong> – The hash algorithm to use Legal values are for example ‘sha1’,’sha224’, -‘sha256’, ‘ripemd160’, and ‘md5’.</li> +‘sha256’, ‘ripemd160’, and ‘md5’.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 or 0, depending on whether the signature was +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>1 or 0, depending on whether the signature was verified or not.</p> -</td> -</tr> -</tbody> -</table> +</dd> +</dl> </dd></dl> </dd></dl> -<dl class="exception"> +<dl class="py exception"> <dt id="M2Crypto.RSA.RSAError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.RSA.</code><code class="descname">RSAError</code><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSAError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSAError" title="Permalink to this definition">¶</a></dt> +<em class="property">exception </em><code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">RSAError</code><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSAError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSAError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> </dd></dl> -<dl class="class"> +<dl class="py class"> <dt id="M2Crypto.RSA.RSA_pub"> -<em class="property">class </em><code class="descclassname">M2Crypto.RSA.</code><code class="descname">RSA_pub</code><span class="sig-paren">(</span><em>rsa</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub" title="Permalink to this definition">¶</a></dt> +<em class="property">class </em><code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">RSA_pub</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rsa</span><span class="p">:</span> <span class="n">bytes</span></em>, <em class="sig-param"><span class="n">_pyfree</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.RSA.RSA</span></code></a></p> <p>Object interface to an RSA public key.</p> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA_pub.check_key"> -<code class="descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.check_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">check_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.check_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.check_key" title="Permalink to this definition">¶</a></dt> <dd><p>Validate RSA keys.</p> <p>It checks that p and q are in fact prime, and that n = p*q.</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">returns 1 if rsa is a valid RSA key, and 0 otherwise. +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>returns 1 if rsa is a valid RSA key, and 0 otherwise. -1 is returned if an error occurs while checking the key. If the key is invalid or an error occurred, the reason -code can be obtained using ERR_get_error(3).</td> -</tr> -</tbody> -</table> +code can be obtained using ERR_get_error(3).</p> +</dd> +</dl> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA_pub.private_decrypt"> -<code class="descname">private_decrypt</code><span class="sig-paren">(</span><em>*argv</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.private_decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.private_decrypt" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">private_decrypt</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">argv</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.private_decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.private_decrypt" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA_pub.private_encrypt"> -<code class="descname">private_encrypt</code><span class="sig-paren">(</span><em>*argv</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.private_encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.private_encrypt" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">private_encrypt</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">argv</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.private_encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.private_encrypt" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA_pub.save_key"> -<code class="descname">save_key</code><span class="sig-paren">(</span><em>file</em>, <em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.save_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file</span><span class="p">:</span> <span class="n">AnyStr</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Any</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kw</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.save_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.save_key" title="Permalink to this definition">¶</a></dt> <dd><p>Save public key to file.</p> </dd></dl> -<dl class="method"> +<dl class="py method"> <dt id="M2Crypto.RSA.RSA_pub.save_key_bio"> -<code class="descname">save_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.save_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-name descname">save_key_bio</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bio</span><span class="p">:</span> <span class="n">BIO.BIO</span></em>, <em class="sig-param"><span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Any</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kw</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/RSA.html#RSA_pub.save_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.RSA_pub.save_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Save public key to BIO.</p> </dd></dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.gen_key"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">gen_key</code><span class="sig-paren">(</span><em>bits</em>, <em>e</em>, <em>callback=<function keygen_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#gen_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.gen_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">gen_key</code><span class="sig-paren">(</span><em class="sig-param">bits: int</em>, <em class="sig-param">e: int</em>, <em class="sig-param">callback: Callable = <function keygen_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA">M2Crypto.RSA.RSA</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#gen_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.gen_key" title="Permalink to this definition">¶</a></dt> <dd><p>Generate an RSA key pair.</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>bits</strong> – Key length, in bits.</li> -<li><strong>e</strong> – The RSA public exponent.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>bits</strong> – Key length, in bits.</p></li> +<li><p><strong>e</strong> – The RSA public exponent.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked during key generation; its usual purpose is to provide visual feedback. The default callback is -keygen_callback.</li> +keygen_callback.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.RSA.RSA object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.keygen_callback"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">keygen_callback</code><span class="sig-paren">(</span><em>p</em>, <em>n</em>, <em>out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#keygen_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.keygen_callback" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">keygen_callback</code><span class="sig-paren">(</span><em class="sig-param">p: int</em>, <em class="sig-param">n: Any</em>, <em class="sig-param">out: IO[str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/RSA.html#keygen_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.keygen_callback" title="Permalink to this definition">¶</a></dt> <dd><p>Default callback for gen_key().</p> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.load_key"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">load_key</code><span class="sig-paren">(</span><em>file</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">load_key</code><span class="sig-paren">(</span><em class="sig-param">file: AnyStr</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA">M2Crypto.RSA.RSA</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_key" title="Permalink to this definition">¶</a></dt> <dd><p>Load an RSA key pair from 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 simple"> -<li><strong>file</strong> – Name of file containing RSA public key in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>file</strong> – Name of file containing RSA public key in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.</li> +key. The default is util.passphrase_callback.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.RSA.RSA object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.load_key_bio"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">load_key_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">load_key_bio</code><span class="sig-paren">(</span><em class="sig-param">bio: BIO.BIO</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA">RSA</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Load an RSA key pair from an M2Crypto.BIO.BIO object.</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>bio</strong> – M2Crypto.BIO.BIO object containing RSA key pair in PEM -format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>bio</strong> – M2Crypto.BIO.BIO object containing RSA key pair in PEM +format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.</li> +key. The default is util.passphrase_callback.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.RSA.RSA object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.load_key_string"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">load_key_string</code><span class="sig-paren">(</span><em>string</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_key_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_key_string" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">load_key_string</code><span class="sig-paren">(</span><em class="sig-param">string: AnyStr</em>, <em class="sig-param">callback: Callable = <function passphrase_callback></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA" title="M2Crypto.RSA.RSA">M2Crypto.RSA.RSA</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_key_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_key_string" title="Permalink to this definition">¶</a></dt> <dd><p>Load an RSA key pair from a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing RSA key pair in PEM format.</li> -<li><strong>callback</strong> – A Python callable object that is invoked +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>string</strong> – String containing RSA key pair in PEM format.</p></li> +<li><p><strong>callback</strong> – A Python callable object that is invoked to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.</li> +key. The default is util.passphrase_callback.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.RSA.RSA object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.load_pub_key"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">load_pub_key</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_pub_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">load_pub_key</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file</span><span class="p">:</span> <span class="n">AnyStr</span></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA_pub" title="M2Crypto.RSA.RSA_pub">M2Crypto.RSA.RSA_pub</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_pub_key" title="Permalink to this definition">¶</a></dt> <dd><p>Load an RSA public key from 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>file</strong> – Name of file containing RSA public key in PEM format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.RSA.RSA_pub object.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>file</strong> – Name of file containing RSA public key in PEM format.</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA_pub object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.load_pub_key_bio"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">load_pub_key_bio</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_pub_key_bio" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">load_pub_key_bio</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">bio</span><span class="p">:</span> <span class="n">BIO.BIO</span></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA_pub" title="M2Crypto.RSA.RSA_pub">RSA_pub</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#load_pub_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.load_pub_key_bio" title="Permalink to this definition">¶</a></dt> <dd><p>Load an RSA public key from an M2Crypto.BIO.BIO object.</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>bio</strong> – M2Crypto.BIO.BIO object containing RSA public key in PEM -format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.RSA.RSA_pub object.</td> -</tr> -</tbody> -</table> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>bio</strong> – M2Crypto.BIO.BIO object containing RSA public key in PEM +format.</p> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA_pub object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.new_pub_key"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">new_pub_key</code><span class="sig-paren">(</span><em>e_n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#new_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.new_pub_key" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">new_pub_key</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">e_n</span><span class="p">:</span> <span class="n">Tuple<span class="p">[</span>bytes<span class="p">, </span>bytes<span class="p">]</span></span></em><span class="sig-paren">)</span> → <a class="reference internal" href="#M2Crypto.RSA.RSA_pub" title="M2Crypto.RSA.RSA_pub">M2Crypto.RSA.RSA_pub</a><a class="reference internal" href="_modules/M2Crypto/RSA.html#new_pub_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.new_pub_key" title="Permalink to this definition">¶</a></dt> <dd><p>Instantiate an RSA_pub object from an (e, n) 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"><ul class="first simple"> -<li><strong>e</strong> – The RSA public exponent; it is a string in OpenSSL’s MPINT +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>e</strong> – The RSA public exponent; it is a string in OpenSSL’s MPINT format - 4-byte big-endian bit-count followed by the -appropriate number of bits.</li> -<li><strong>n</strong> – The RSA composite of primes; it is a string in OpenSSL’s +appropriate number of bits.</p></li> +<li><p><strong>n</strong> – The RSA composite of primes; it is a string in OpenSSL’s MPINT format - 4-byte big-endian bit-count followed by the -appropriate number of bits.</li> +appropriate number of bits.</p></li> </ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.RSA.RSA_pub object.</p> -</td> -</tr> -</tbody> -</table> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>M2Crypto.RSA.RSA_pub object.</p> +</dd> +</dl> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.RSA.rsa_error"> -<code class="descclassname">M2Crypto.RSA.</code><code class="descname">rsa_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/RSA.html#rsa_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.rsa_error" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.RSA.</code><code class="sig-name descname">rsa_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/RSA.html#rsa_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.RSA.rsa_error" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </div> -<div class="section" id="module-M2Crypto.Rand"> -<span id="rand-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Rand</span></code> Module<a class="headerlink" href="#module-M2Crypto.Rand" title="Permalink to this headline">¶</a></h2> -<p>M2Crypto wrapper for OpenSSL PRNG. Requires OpenSSL 0.9.5 and above.</p> -<p>Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. -Copyright (c) 2014-2017 Matej Cepl. All rights reserved.</p> -<p>See LICENCE for the license information.</p> -<dl class="function"> -<dt id="M2Crypto.Rand.rand_seed"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">rand_seed</code><span class="sig-paren">(</span><em>seed</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#rand_seed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.rand_seed" title="Permalink to this definition">¶</a></dt> -<dd><p>Equivalent to rand_add() when len(seed) == entropy.</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>seed</strong> – added data (see description at rand_add)</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.rand_add"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">rand_add</code><span class="sig-paren">(</span><em>blob</em>, <em>entropy</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#rand_add"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.rand_add" title="Permalink to this definition">¶</a></dt> -<dd><p>Mixes blob into the PRNG state.</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>blob</strong> – added data</li> -<li><strong>entropy</strong> – (the lower bound of) an estimate of how much randomness -is contained in blob, measured in bytes.</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p>Thus, if the data at buf are unpredictable to an adversary, this -increases the uncertainty about the state and makes the PRNG output less -predictable. Suitable input comes from user interaction (random key -presses, mouse movements) and certain hardware events.</p> -<p>Details about sources of randomness and how to estimate their entropy -can be found in the literature, e.g. RFC 1750.</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.load_file"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">load_file</code><span class="sig-paren">(</span><em>filename</em>, <em>max_bytes</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#load_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.load_file" title="Permalink to this definition">¶</a></dt> -<dd><p>Read a number of bytes from file filename and adds them to the PRNG.</p> -<p>If max_bytes is non-negative, up to to max_bytes are read; starting with -OpenSSL 0.9.5, if max_bytes is -1, the complete file is read.</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>filename</strong> – </li> -<li><strong>max_bytes</strong> – </li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">the number of bytes read.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.save_file"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">save_file</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#save_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.save_file" title="Permalink to this definition">¶</a></dt> -<dd><p>Write a number of random bytes (currently 1024) to file.</p> -<p>The file then can be used to initialize the PRNG by calling load_file() in -a later session.</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> – </td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">returns the number of bytes written, and -1 if the bytes -written were generated without appropriate seed.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.rand_bytes"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">rand_bytes</code><span class="sig-paren">(</span><em>num</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#rand_bytes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.rand_bytes" title="Permalink to this definition">¶</a></dt> -<dd><p>Return n cryptographically strong pseudo-random bytes.</p> -<p>An error occurs if the PRNG has not been seeded with enough randomness -to ensure an unpredictable byte sequence.</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>num</strong> – number of bytes to be returned</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">random bytes</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.rand_pseudo_bytes"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">rand_pseudo_bytes</code><span class="sig-paren">(</span><em>num</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#rand_pseudo_bytes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.rand_pseudo_bytes" title="Permalink to this definition">¶</a></dt> -<dd><p>Return num pseudo-random bytes into buf.</p> -<p>Pseudo-random byte sequences generated by this method will be unique -if they are of sufficient length, but are not necessarily -unpredictable. They can be used for non-cryptographic purposes and for -certain purposes in cryptographic protocols, but usually not for key -generation etc.</p> -<p>Output of the function is mixed into the entropy pool before -retrieving the new pseudo-random bytes unless disabled at compile -time (see FAQ).</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>num</strong> – number of bytes to be returned</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">random bytes</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.rand_file_name"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">rand_file_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#rand_file_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.rand_file_name" title="Permalink to this definition">¶</a></dt> -<dd><p>Generate a default path for the random seed 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">Returns:</th><td class="field-body">string with the filename. -The seed file is $RANDFILE if that environment variable -is set, $HOME/.rnd otherwise. If $HOME is not set either, -an error occurs.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.Rand.rand_status"> -<code class="descclassname">M2Crypto.Rand.</code><code class="descname">rand_status</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/Rand.html#rand_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.Rand.rand_status" title="Permalink to this definition">¶</a></dt> -<dd><p>Check whether there is enough entropy in PRNG.</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">1 if the PRNG has been seeded with enough -data, 0 otherwise.</td> -</tr> -</tbody> -</table> -</dd></dl> - +<div class="section" id="rand-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">Rand</span></code> Module<a class="headerlink" href="#rand-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.SMIME"> -<span id="smime-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">SMIME</span></code> Module<a class="headerlink" href="#module-M2Crypto.SMIME" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.SMIME.Cipher"> -<em class="property">class </em><code class="descclassname">M2Crypto.SMIME.</code><code class="descname">Cipher</code><span class="sig-paren">(</span><em>algo</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#Cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.Cipher" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>Object interface to EVP_CIPHER without all the frills of -M2Crypto.EVP.Cipher.</p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.SMIME.PKCS7"> -<em class="property">class </em><code class="descclassname">M2Crypto.SMIME.</code><code class="descname">PKCS7</code><span class="sig-paren">(</span><em>pkcs7=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#PKCS7"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.PKCS7" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.SMIME.PKCS7.get0_signers"> -<code class="descname">get0_signers</code><span class="sig-paren">(</span><em>certs</em>, <em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#PKCS7.get0_signers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.PKCS7.get0_signers" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.PKCS7.m2_pkcs7_free"> -<code class="descname">m2_pkcs7_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.SMIME.PKCS7.m2_pkcs7_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.PKCS7.type"> -<code class="descname">type</code><span class="sig-paren">(</span><em>text_name=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#PKCS7.type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.PKCS7.type" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.PKCS7.write"> -<code class="descname">write</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#PKCS7.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.PKCS7.write" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.PKCS7.write_der"> -<code class="descname">write_der</code><span class="sig-paren">(</span><em>bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#PKCS7.write_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.PKCS7.write_der" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.SMIME.PKCS7_Error"> -<em class="property">exception </em><code class="descclassname">M2Crypto.SMIME.</code><code class="descname">PKCS7_Error</code><a class="reference internal" href="_modules/M2Crypto/SMIME.html#PKCS7_Error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.PKCS7_Error" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.SMIME.SMIME"> -<em class="property">class </em><code class="descclassname">M2Crypto.SMIME.</code><code class="descname">SMIME</code><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.decrypt"> -<code class="descname">decrypt</code><span class="sig-paren">(</span><em>pkcs7</em>, <em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.decrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.decrypt" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.encrypt"> -<code class="descname">encrypt</code><span class="sig-paren">(</span><em>data_bio</em>, <em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.encrypt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.encrypt" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.load_key"> -<code class="descname">load_key</code><span class="sig-paren">(</span><em>keyfile</em>, <em>certfile=None</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.load_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.load_key" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.load_key_bio"> -<code class="descname">load_key_bio</code><span class="sig-paren">(</span><em>keybio</em>, <em>certbio=None</em>, <em>callback=<function passphrase_callback></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.load_key_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.load_key_bio" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.set_cipher"> -<code class="descname">set_cipher</code><span class="sig-paren">(</span><em>cipher</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.set_cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.set_cipher" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.set_x509_stack"> -<code class="descname">set_x509_stack</code><span class="sig-paren">(</span><em>stack</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.set_x509_stack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.set_x509_stack" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.set_x509_store"> -<code class="descname">set_x509_store</code><span class="sig-paren">(</span><em>store</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.set_x509_store"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.set_x509_store" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.sign"> -<code class="descname">sign</code><span class="sig-paren">(</span><em>data_bio</em>, <em>flags=0</em>, <em>algo='sha1'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.sign" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.unset_cipher"> -<code class="descname">unset_cipher</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.unset_cipher"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.unset_cipher" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.unset_key"> -<code class="descname">unset_key</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.unset_key"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.unset_key" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.unset_x509_stack"> -<code class="descname">unset_x509_stack</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.unset_x509_stack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.unset_x509_stack" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.unset_x509_store"> -<code class="descname">unset_x509_store</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.unset_x509_store"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.unset_x509_store" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.verify"> -<code class="descname">verify</code><span class="sig-paren">(</span><em>pkcs7</em>, <em>data_bio=None</em>, <em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.verify" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.SMIME.SMIME.write"> -<code class="descname">write</code><span class="sig-paren">(</span><em>out_bio</em>, <em>pkcs7</em>, <em>data_bio=None</em>, <em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME.write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME.write" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.SMIME.SMIME_Error"> -<em class="property">exception </em><code class="descclassname">M2Crypto.SMIME.</code><code class="descname">SMIME_Error</code><a class="reference internal" href="_modules/M2Crypto/SMIME.html#SMIME_Error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.SMIME_Error" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.load_pkcs7"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">load_pkcs7</code><span class="sig-paren">(</span><em>p7file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#load_pkcs7"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.load_pkcs7" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.load_pkcs7_bio"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">load_pkcs7_bio</code><span class="sig-paren">(</span><em>p7_bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#load_pkcs7_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.load_pkcs7_bio" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.load_pkcs7_bio_der"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">load_pkcs7_bio_der</code><span class="sig-paren">(</span><em>p7_bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#load_pkcs7_bio_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.load_pkcs7_bio_der" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.load_pkcs7_der"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">load_pkcs7_der</code><span class="sig-paren">(</span><em>p7file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#load_pkcs7_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.load_pkcs7_der" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.smime_load_pkcs7"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">smime_load_pkcs7</code><span class="sig-paren">(</span><em>p7file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#smime_load_pkcs7"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.smime_load_pkcs7" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.smime_load_pkcs7_bio"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">smime_load_pkcs7_bio</code><span class="sig-paren">(</span><em>p7_bio</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#smime_load_pkcs7_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.smime_load_pkcs7_bio" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.text_crlf"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">text_crlf</code><span class="sig-paren">(</span><em>text</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#text_crlf"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.text_crlf" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="function"> -<dt id="M2Crypto.SMIME.text_crlf_bio"> -<code class="descclassname">M2Crypto.SMIME.</code><code class="descname">text_crlf_bio</code><span class="sig-paren">(</span><em>bio_in</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/SMIME.html#text_crlf_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.SMIME.text_crlf_bio" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - +<div class="section" id="smime-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">SMIME</span></code> Module<a class="headerlink" href="#smime-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.X509"> -<span id="x509-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">X509</span></code> Module<a class="headerlink" href="#module-M2Crypto.X509" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.X509.CRL"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">CRL</code><span class="sig-paren">(</span><em>crl=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#CRL"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.CRL" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Certificate Revocation List</p> -<dl class="method"> -<dt id="M2Crypto.X509.CRL.as_text"> -<code class="descname">as_text</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#CRL.as_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.CRL.as_text" title="Permalink to this definition">¶</a></dt> -<dd><p>Return CRL in PEM format in a 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">Returns:</th><td class="field-body">String containing the CRL in PEM format.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.CRL.m2_x509_crl_free"> -<code class="descname">m2_x509_crl_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.CRL.m2_x509_crl_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.Request"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">Request</code><span class="sig-paren">(</span><em>req=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Certificate Request.</p> -<dl class="method"> -<dt id="M2Crypto.X509.Request.add_extensions"> -<code class="descname">add_extensions</code><span class="sig-paren">(</span><em>ext_stack</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.add_extensions"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.add_extensions" title="Permalink to this definition">¶</a></dt> -<dd><p>Add X509 extensions to this request.</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>ext_stack</strong> – Stack of extensions to add.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 for success and 0 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.as_der"> -<code class="descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.as_der" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.as_pem"> -<code class="descname">as_pem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.as_pem" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.as_text"> -<code class="descname">as_text</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.as_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.as_text" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.get_pubkey"> -<code class="descname">get_pubkey</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.get_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.get_pubkey" title="Permalink to this definition">¶</a></dt> -<dd><p>Get the public key for the request.</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">Public key from the request.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.get_subject"> -<code class="descname">get_subject</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.get_subject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.get_subject" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.get_version"> -<code class="descname">get_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.get_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.get_version" title="Permalink to this definition">¶</a></dt> -<dd><p>Get version.</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">Returns version.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.m2_x509_req_free"> -<code class="descname">m2_x509_req_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.Request.m2_x509_req_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.save"> -<code class="descname">save</code><span class="sig-paren">(</span><em>filename</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.save"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.save" title="Permalink to this definition">¶</a></dt> -<dd><p>Saves X.509 certificate request to a file. Default output -format is PEM.</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>filename</strong> – Name of the file the request will be saved to.</li> -<li><strong>format</strong> – Controls what output format is used to save the -request. Either FORMAT_PEM or FORMAT_DER to save -in PEM or DER format. Raises ValueError if an -unknown format is used.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 for success, 0 for failure. -The error code can be obtained by ERR_get_error.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.save_pem"> -<code class="descname">save_pem</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.save_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.save_pem" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.set_pubkey"> -<code class="descname">set_pubkey</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.set_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.set_pubkey" title="Permalink to this definition">¶</a></dt> -<dd><p>Set the public key for the request.</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>pkey</strong> – Public key</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Return 1 for success and 0 for failure.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.set_subject"> -<code class="descname">set_subject</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.Request.set_subject" title="Permalink to this definition">¶</a></dt> -<dd><p>Set subject name.</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>name</strong> – subjectName field.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 for success and 0 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.set_subject_name"> -<code class="descname">set_subject_name</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.set_subject_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.set_subject_name" title="Permalink to this definition">¶</a></dt> -<dd><p>Set subject name.</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>name</strong> – subjectName field.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 for success and 0 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.set_version"> -<code class="descname">set_version</code><span class="sig-paren">(</span><em>version</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.set_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.set_version" title="Permalink to this definition">¶</a></dt> -<dd><p>Set version.</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> – Version number.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns 0 on failure.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.sign"> -<code class="descname">sign</code><span class="sig-paren">(</span><em>pkey</em>, <em>md</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.sign" title="Permalink to this definition">¶</a></dt> -<dd><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>pkey</strong> – PKey to be signed</li> -<li><strong>md</strong> – used algorigthm</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 for success and 0 for failure</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.Request.verify"> -<code class="descname">verify</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#Request.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.Request.verify" title="Permalink to this definition">¶</a></dt> -<dd><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>pkey</strong> – PKey to be verified</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 for success and 0 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509</code><span class="sig-paren">(</span><em>x509=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X.509 Certificate</p> -<dl class="method"> -<dt id="M2Crypto.X509.X509.add_ext"> -<code class="descname">add_ext</code><span class="sig-paren">(</span><em>ext</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.add_ext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.add_ext" title="Permalink to this definition">¶</a></dt> -<dd><p>Add X509 extension to this certificate.</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>ext</strong> – Extension</td> -</tr> -</tbody> -</table> -<p>:return 1 for success and 0 for failure</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.as_der"> -<code class="descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.as_der" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.as_pem"> -<code class="descname">as_pem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.as_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.as_pem" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.as_text"> -<code class="descname">as_text</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.as_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.as_text" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.check_ca"> -<code class="descname">check_ca</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.check_ca"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.check_ca" title="Permalink to this definition">¶</a></dt> -<dd><p>Check if the certificate is a Certificate Authority (CA) certificate.</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">0 if the certificate is not CA, nonzero otherwise.</td> -</tr> -<tr class="field-even field"><th class="field-name">Requires:</th><td class="field-body">OpenSSL 0.9.8 or newer</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.check_purpose"> -<code class="descname">check_purpose</code><span class="sig-paren">(</span><em>id</em>, <em>ca</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.check_purpose"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.check_purpose" title="Permalink to this definition">¶</a></dt> -<dd><p>Check if the certificate’s purpose matches the asked purpose.</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>id</strong> – Purpose id. See X509_PURPOSE_* constants.</li> -<li><strong>ca</strong> – 1 if the certificate should be CA, 0 otherwise.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">0 if the certificate purpose does not match, nonzero -otherwise.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_ext"> -<code class="descname">get_ext</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_ext"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_ext" title="Permalink to this definition">¶</a></dt> -<dd><p>Get X509 extension by name.</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>name</strong> – Name of the extension</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">X509_Extension</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_ext_at"> -<code class="descname">get_ext_at</code><span class="sig-paren">(</span><em>index</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_ext_at"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_ext_at" title="Permalink to this definition">¶</a></dt> -<dd><p>Get X509 extension by index.</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>index</strong> – Name of the extension</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">X509_Extension</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_ext_count"> -<code class="descname">get_ext_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_ext_count"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_ext_count" title="Permalink to this definition">¶</a></dt> -<dd><p>Get X509 extension count.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_fingerprint"> -<code class="descname">get_fingerprint</code><span class="sig-paren">(</span><em>md='md5'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_fingerprint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_fingerprint" title="Permalink to this definition">¶</a></dt> -<dd><p>Get the fingerprint of the certificate.</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>md</strong> – Message digest algorithm to use.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">String containing the fingerprint in hex format.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_issuer"> -<code class="descname">get_issuer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_issuer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_issuer" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_not_after"> -<code class="descname">get_not_after</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_not_after"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_not_after" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_not_before"> -<code class="descname">get_not_before</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_not_before"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_not_before" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_pubkey"> -<code class="descname">get_pubkey</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_pubkey" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_serial_number"> -<code class="descname">get_serial_number</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_serial_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_serial_number" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_subject"> -<code class="descname">get_subject</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_subject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_subject" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.get_version"> -<code class="descname">get_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.get_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.get_version" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.m2_x509_free"> -<code class="descname">m2_x509_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509.m2_x509_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.save"> -<code class="descname">save</code><span class="sig-paren">(</span><em>filename</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.save"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.save" title="Permalink to this definition">¶</a></dt> -<dd><p>Saves X.509 certificate to a file. Default output -format is PEM.</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>filename</strong> – Name of the file the cert will be saved to.</li> -<li><strong>format</strong> – Controls what output format is used to save the cert. -Either FORMAT_PEM or FORMAT_DER to save in PEM or -DER format. Raises a ValueError if an unknow -format is used.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 for success or 0 for failure</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.save_pem"> -<code class="descname">save_pem</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.save_pem"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.save_pem" title="Permalink to this definition">¶</a></dt> -<dd><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> – name of the file to be loaded</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 for success or 0 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_issuer"> -<code class="descname">set_issuer</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_issuer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_issuer" title="Permalink to this definition">¶</a></dt> -<dd><p>Set issuer name.</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>name</strong> – subjectName field.</td> -</tr> -</tbody> -</table> -<p>:return 1 for success and 0 for failure</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_issuer_name"> -<code class="descname">set_issuer_name</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_issuer_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_issuer_name" title="Permalink to this definition">¶</a></dt> -<dd><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">1 on success, 0 on failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_not_after"> -<code class="descname">set_not_after</code><span class="sig-paren">(</span><em>asn1_time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_not_after"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_not_after" title="Permalink to this definition">¶</a></dt> -<dd><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">1 on success, 0 on failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_not_before"> -<code class="descname">set_not_before</code><span class="sig-paren">(</span><em>asn1_time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_not_before"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_not_before" title="Permalink to this definition">¶</a></dt> -<dd><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">1 on success, 0 on failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_pubkey"> -<code class="descname">set_pubkey</code><span class="sig-paren">(</span><em>pkey</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_pubkey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_pubkey" title="Permalink to this definition">¶</a></dt> -<dd><p>Set the public key for the certificate</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>pkey</strong> – Public key</td> -</tr> -</tbody> -</table> -<p>:return 1 for success and 0 for failure</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_serial_number"> -<code class="descname">set_serial_number</code><span class="sig-paren">(</span><em>serial</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_serial_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_serial_number" title="Permalink to this definition">¶</a></dt> -<dd><p>Set serial number.</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>serial</strong> – Serial number.</td> -</tr> -</tbody> -</table> -<p>:return 1 for success and 0 for failure.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_subject"> -<code class="descname">set_subject</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_subject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_subject" title="Permalink to this definition">¶</a></dt> -<dd><p>Set subject name.</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>name</strong> – subjectName field.</td> -</tr> -</tbody> -</table> -<p>:return 1 for success and 0 for failure</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_subject_name"> -<code class="descname">set_subject_name</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_subject_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_subject_name" title="Permalink to this definition">¶</a></dt> -<dd><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">1 on success, 0 on failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.set_version"> -<code class="descname">set_version</code><span class="sig-paren">(</span><em>version</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.set_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.set_version" title="Permalink to this definition">¶</a></dt> -<dd><p>Set version of the certificate.</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> – Version number.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Returns 0 on failure.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.sign"> -<code class="descname">sign</code><span class="sig-paren">(</span><em>pkey</em>, <em>md</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.sign"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.sign" title="Permalink to this definition">¶</a></dt> -<dd><p>Sign the certificate.</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>pkey</strong> – Public key</li> -<li><strong>md</strong> – Message digest algorithm to use for signing, -for example ‘sha1’.</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p>:return int</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509.verify"> -<code class="descname">verify</code><span class="sig-paren">(</span><em>pkey=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509.verify"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509.verify" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="exception"> -<dt id="M2Crypto.X509.X509Error"> -<em class="property">exception </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509Error</code><a class="reference internal" href="_modules/M2Crypto/X509.html#X509Error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509Error" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ValueError</span></code></p> -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Extension"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Extension</code><span class="sig-paren">(</span><em>x509_ext_ptr=None</em>, <em>_pyfree=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Extension</p> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension.get_critical"> -<code class="descname">get_critical</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension.get_critical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension.get_critical" title="Permalink to this definition">¶</a></dt> -<dd><p>Return whether or not this is a critical extension.</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">Nonzero if this is a critical extension.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension.get_name"> -<code class="descname">get_name</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension.get_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension.get_name" title="Permalink to this definition">¶</a></dt> -<dd><p>Get the extension name, for example ‘subjectAltName’.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension.get_value"> -<code class="descname">get_value</code><span class="sig-paren">(</span><em>flag=0</em>, <em>indent=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension.get_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension.get_value" title="Permalink to this definition">¶</a></dt> -<dd><p>Get the extension value, for example ‘<a class="reference external" href="DNS:www.example.com">DNS:www.example.com</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>flag</strong> – Flag to control what and how to print.</li> -<li><strong>indent</strong> – How many spaces to print before actual value.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension.m2_x509_extension_free"> -<code class="descname">m2_x509_extension_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Extension.m2_x509_extension_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension.set_critical"> -<code class="descname">set_critical</code><span class="sig-paren">(</span><em>critical=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension.set_critical"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension.set_critical" title="Permalink to this definition">¶</a></dt> -<dd><p>Mark this extension critical or noncritical. By default an -extension is not critical.</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>critical</strong> – Nonzero sets this extension as critical. -Calling this method without arguments will -set this extension to critical.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 for success, 0 for failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Extension_Stack"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Extension_Stack</code><span class="sig-paren">(</span><em>stack=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension_Stack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension_Stack" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Extension Stack</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">Warning:</th><td class="field-body">Do not modify the underlying OpenSSL stack -except through this interface, or use any OpenSSL -functions that do so indirectly. Doing so will get the -OpenSSL stack and the internal pystack of this class out -of sync, leading to python memory leaks, exceptions or -even python crashes!</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension_Stack.m2_sk_x509_extension_free"> -<code class="descname">m2_sk_x509_extension_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Extension_Stack.m2_sk_x509_extension_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension_Stack.pop"> -<code class="descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension_Stack.pop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension_Stack.pop" title="Permalink to this definition">¶</a></dt> -<dd><p>Pop X509_Extension object from the stack.</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">X509_Extension popped</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Extension_Stack.push"> -<code class="descname">push</code><span class="sig-paren">(</span><em>x509_ext</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Extension_Stack.push"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Extension_Stack.push" title="Permalink to this definition">¶</a></dt> -<dd><p>Push X509_Extension object onto the stack.</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>x509_ext</strong> – X509_Extension object to be pushed onto the stack.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The number of extensions on the stack.</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Name"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Name</code><span class="sig-paren">(</span><em>x509_name=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Name</p> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.add_entry_by_txt"> -<code class="descname">add_entry_by_txt</code><span class="sig-paren">(</span><em>field</em>, <em>type</em>, <em>entry</em>, <em>len</em>, <em>loc</em>, <em>set</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name.add_entry_by_txt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name.add_entry_by_txt" title="Permalink to this definition">¶</a></dt> -<dd><p>Add X509_Name field whose name is identified by its name.</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>field</strong> – name of the entry</li> -<li><strong>type</strong> – use MBSTRING_ASC or MBSTRING_UTF8 -(or standard ASN1 type like V_ASN1_IA5STRING)</li> -<li><strong>entry</strong> – value</li> -<li><strong>len</strong> – buf_len of the entry -(-1 and the length is computed automagically)</li> -</ul> -</td> -</tr> -</tbody> -</table> -<p>The <code class="docutils literal notranslate"><span class="pre">loc</span></code> and <code class="docutils literal notranslate"><span class="pre">set</span></code> parameters determine where a new entry -should be added. -For almost all applications loc can be set to -1 and set to 0. -This adds a new entry to the end of name as a single valued -RelativeDistinguishedName (RDN).</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>loc</strong> – determines the index where the new entry is -inserted: if it is -1 it is appended.</li> -<li><strong>set</strong> – determines how the new type is added. If it is zero -a new RDN is created. -If set is -1 or 1 it is added to the previous or next RDN -structure respectively. This will then be a multivalued -RDN: since multivalues RDNs are very seldom used set is -almost always set to zero.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">1 for success of 0 if an error occurred.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.as_der"> -<code class="descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name.as_der" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.as_hash"> -<code class="descname">as_hash</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name.as_hash"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name.as_hash" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.as_text"> -<code class="descname">as_text</code><span class="sig-paren">(</span><em>indent=0</em>, <em>flags=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name.as_text"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name.as_text" title="Permalink to this definition">¶</a></dt> -<dd><p>as_text returns the name as a 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"><ul class="first last simple"> -<li><strong>indent</strong> – Each line in multiline format is indented -by this many spaces.</li> -<li><strong>flags</strong> – Flags that control how the output should be formatted.</li> -</ul> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.entry_count"> -<code class="descname">entry_count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name.entry_count"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name.entry_count" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.get_entries_by_nid"> -<code class="descname">get_entries_by_nid</code><span class="sig-paren">(</span><em>nid</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name.get_entries_by_nid"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name.get_entries_by_nid" title="Permalink to this definition">¶</a></dt> -<dd><p>Retrieve the next index matching nid.</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>nid</strong> – name of the entry (as m2.NID* constants)</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">list of X509_Name_Entry items</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name.m2_x509_name_free"> -<code class="descname">m2_x509_name_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Name.m2_x509_name_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="attribute"> -<dt id="M2Crypto.X509.X509_Name.nid"> -<code class="descname">nid</code><em class="property"> = {'C': 14, 'CN': 13, 'Email': 48, 'GN': 99, 'L': 15, 'O': 17, 'OU': 18, 'SN': 100, 'SP': 16, 'ST': 16, 'commonName': 13, 'emailAddress': 48, 'givenName': 99, 'localityName': 15, 'organizationName': 17, 'organizationUnitName': 18, 'serialNumber': 105, 'stateOrProvinceName': 16, 'surname': 100}</em><a class="headerlink" href="#M2Crypto.X509.X509_Name.nid" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Name_Entry"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Name_Entry</code><span class="sig-paren">(</span><em>x509_name_entry</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name_Entry"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Name Entry</p> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name_Entry.create_by_txt"> -<code class="descname">create_by_txt</code><span class="sig-paren">(</span><em>field</em>, <em>type</em>, <em>entry</em>, <em>len</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name_Entry.create_by_txt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry.create_by_txt" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name_Entry.get_data"> -<code class="descname">get_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name_Entry.get_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry.get_data" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name_Entry.get_object"> -<code class="descname">get_object</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name_Entry.get_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry.get_object" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name_Entry.m2_x509_name_entry_free"> -<code class="descname">m2_x509_name_entry_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry.m2_x509_name_entry_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name_Entry.set_data"> -<code class="descname">set_data</code><span class="sig-paren">(</span><em>data</em>, <em>type=4097</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name_Entry.set_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry.set_data" title="Permalink to this definition">¶</a></dt> -<dd><p>Sets the field name to asn1obj</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>data</strong> – data in a binary form to be set</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">0 on failure, 1 on success</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Name_Entry.set_object"> -<code class="descname">set_object</code><span class="sig-paren">(</span><em>asn1obj</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Name_Entry.set_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Name_Entry.set_object" title="Permalink to this definition">¶</a></dt> -<dd><p>Sets the field name to asn1obj</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>asn1obj</strong> – </td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">0 on failure, 1 on success</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Stack"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Stack</code><span class="sig-paren">(</span><em>stack=None</em>, <em>_pyfree=0</em>, <em>_pyfree_x509=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Stack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Stack" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Stack</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">Warning:</th><td class="field-body">Do not modify the underlying OpenSSL stack -except through this interface, or use any OpenSSL -functions that do so indirectly. Doing so will get the -OpenSSL stack and the internal pystack of this class out -of sync, leading to python memory leaks, exceptions or -even python crashes!</td> -</tr> -</tbody> -</table> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Stack.as_der"> -<code class="descname">as_der</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Stack.as_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Stack.as_der" title="Permalink to this definition">¶</a></dt> -<dd><p>Return the stack as a DER encoded string</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Stack.m2_sk_x509_free"> -<code class="descname">m2_sk_x509_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Stack.m2_sk_x509_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Stack.pop"> -<code class="descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Stack.pop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Stack.pop" title="Permalink to this definition">¶</a></dt> -<dd><p>pop a certificate from the stack.</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">X509 object that was popped, or None if there is -nothing to pop.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Stack.push"> -<code class="descname">push</code><span class="sig-paren">(</span><em>x509</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Stack.push"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Stack.push" title="Permalink to this definition">¶</a></dt> -<dd><p>push an X509 certificate onto the stack.</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>x509</strong> – X509 object.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The number of X509 objects currently on the stack.</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Store"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Store</code><span class="sig-paren">(</span><em>store=None</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Store</p> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store.add_cert"> -<code class="descname">add_cert</code><span class="sig-paren">(</span><em>x509</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Store.add_cert" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store.add_x509"> -<code class="descname">add_x509</code><span class="sig-paren">(</span><em>x509</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store.add_x509"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store.add_x509" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store.load_info"> -<code class="descname">load_info</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store.load_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store.load_info" title="Permalink to this definition">¶</a></dt> -<dd><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>file</strong> – filename</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 on success, 0 on failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store.load_locations"> -<code class="descname">load_locations</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Store.load_locations" title="Permalink to this definition">¶</a></dt> -<dd><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>file</strong> – filename</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">1 on success, 0 on failure</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store.m2_x509_store_free"> -<code class="descname">m2_x509_store_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Store.m2_x509_store_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store.set_verify_cb"> -<code class="descname">set_verify_cb</code><span class="sig-paren">(</span><em>callback=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store.set_verify_cb"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store.set_verify_cb" title="Permalink to this definition">¶</a></dt> -<dd><p>Set callback which will be called when the store is verified. -Wrapper over OpenSSL X509_STORE_set_verify_cb().</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>callback</strong> – Callable to specify verification options. -Type of the callable must be: -(int, X509_Store_Context) -> int. -If None: set the standard options.</td> -</tr> -<tr class="field-even field"><th class="field-name">Note:</th><td class="field-body">compile-time or run-time errors in the callback would result -in mysterious errors during verification, which could be hard -to trace.</td> -</tr> -<tr class="field-odd field"><th class="field-name">Note:</th><td class="field-body">Python exceptions raised in callbacks do not propagate to -verify() call.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">None</td> -</tr> -</tbody> -</table> -</dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.X509.X509_Store_Context"> -<em class="property">class </em><code class="descclassname">M2Crypto.X509.</code><code class="descname">X509_Store_Context</code><span class="sig-paren">(</span><em>x509_store_ctx</em>, <em>_pyfree=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store_Context"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store_Context" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> -<p>X509 Store Context</p> -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store_Context.get1_chain"> -<code class="descname">get1_chain</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store_Context.get1_chain"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store_Context.get1_chain" title="Permalink to this definition">¶</a></dt> -<dd><p>Get certificate chain.</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">Reference counted (i.e. safe to use even after the store -context goes away) stack of certificates in the chain.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store_Context.get_current_cert"> -<code class="descname">get_current_cert</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store_Context.get_current_cert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store_Context.get_current_cert" title="Permalink to this definition">¶</a></dt> -<dd><p>Get current X.509 certificate.</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">Warning:</th><td class="field-body">The returned certificate is NOT refcounted, so you can not -rely on it being valid once the store context goes -away or is modified.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store_Context.get_error"> -<code class="descname">get_error</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store_Context.get_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store_Context.get_error" title="Permalink to this definition">¶</a></dt> -<dd><p>Get error code.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store_Context.get_error_depth"> -<code class="descname">get_error_depth</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#X509_Store_Context.get_error_depth"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.X509_Store_Context.get_error_depth" title="Permalink to this definition">¶</a></dt> -<dd><p>Get error depth.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.X509.X509_Store_Context.m2_x509_store_ctx_free"> -<code class="descname">m2_x509_store_ctx_free</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.X509.X509_Store_Context.m2_x509_store_ctx_free" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_cert"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_cert</code><span class="sig-paren">(</span><em>file</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_cert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_cert" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate from 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 simple"> -<li><strong>file</strong> – Name of file containing certificate in either DER or -PEM format.</li> -<li><strong>format</strong> – Describes the format of the file to be loaded, -either PEM or DER.</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.X509.X509 object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_cert_bio"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_cert_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_cert_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_cert_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate from a bio.</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>bio</strong> – BIO pointing at a certificate in either DER or PEM format.</li> -<li><strong>format</strong> – Describes the format of the cert to be loaded, -either PEM or DER (via constants FORMAT_PEM -and FORMAT_FORMAT_DER)</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.X509.X509 object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_cert_der_string"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_cert_der_string</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_cert_der_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_cert_der_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate from a 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>string</strong> – String containing a certificate in DER format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.X509.X509 object.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_cert_string"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_cert_string</code><span class="sig-paren">(</span><em>string</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_cert_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_cert_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate from a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing a certificate in either DER or PEM format.</li> -<li><strong>format</strong> – Describes the format of the cert to be loaded, -either PEM or DER (via constants FORMAT_PEM -and FORMAT_FORMAT_DER)</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.X509.X509 object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_crl"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_crl</code><span class="sig-paren">(</span><em>file</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_crl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_crl" title="Permalink to this definition">¶</a></dt> -<dd><p>Load CRL from 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>file</strong> – Name of file containing CRL in PEM format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.X509.CRL object.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_request"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_request</code><span class="sig-paren">(</span><em>file</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_request" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate request from 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 simple"> -<li><strong>file</strong> – Name of file containing certificate request in -either PEM or DER format.</li> -<li><strong>format</strong> – Describes the format of the file to be loaded, -either PEM or DER. (using constants FORMAT_PEM -and FORMAT_DER)</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Request object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_request_bio"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_request_bio</code><span class="sig-paren">(</span><em>bio</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_request_bio"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_request_bio" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate request from a bio.</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>bio</strong> – BIO pointing at a certificate request in -either DER or PEM format.</li> -<li><strong>format</strong> – Describes the format of the request to be loaded, -either PEM or DER. (using constants FORMAT_PEM -and FORMAT_DER)</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.X509.Request object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_request_der_string"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_request_der_string</code><span class="sig-paren">(</span><em>string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_request_der_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_request_der_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate request from a 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>string</strong> – String containing a certificate request in DER format.</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">M2Crypto.X509.Request object.</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.load_request_string"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">load_request_string</code><span class="sig-paren">(</span><em>string</em>, <em>format=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#load_request_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.load_request_string" title="Permalink to this definition">¶</a></dt> -<dd><p>Load certificate request from a 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"><ul class="first simple"> -<li><strong>string</strong> – String containing a certificate request in -either DER or PEM format.</li> -<li><strong>format</strong> – Describes the format of the request to be loaded, -either PEM or DER. (using constants FORMAT_PEM -and FORMAT_DER)</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">M2Crypto.X509.Request object.</p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.new_extension"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">new_extension</code><span class="sig-paren">(</span><em>name</em>, <em>value</em>, <em>critical=0</em>, <em>_pyfree=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#new_extension"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.new_extension" title="Permalink to this definition">¶</a></dt> -<dd><p>Create new X509_Extension instance.</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.new_stack_from_der"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">new_stack_from_der</code><span class="sig-paren">(</span><em>der_string</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#new_stack_from_der"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.new_stack_from_der" title="Permalink to this definition">¶</a></dt> -<dd><p>Create a new X509_Stack from DER 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">Returns:</th><td class="field-body">X509_Stack</td> -</tr> -</tbody> -</table> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.X509.x509_store_default_cb"> -<code class="descclassname">M2Crypto.X509.</code><code class="descname">x509_store_default_cb</code><span class="sig-paren">(</span><em>ok</em>, <em>ctx</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/X509.html#x509_store_default_cb"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.X509.x509_store_default_cb" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - +<div class="section" id="x509-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">X509</span></code> Module<a class="headerlink" href="#x509-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.callback"> -<span id="callback-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">callback</span></code> Module<a class="headerlink" href="#module-M2Crypto.callback" title="Permalink to this headline">¶</a></h2> +<div class="section" id="callback-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">callback</span></code> Module<a class="headerlink" href="#callback-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.ftpslib"> -<span id="ftpslib-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">ftpslib</span></code> Module<a class="headerlink" href="#module-M2Crypto.ftpslib" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.ftpslib.FTP_TLS"> -<em class="property">class </em><code class="descclassname">M2Crypto.ftpslib.</code><code class="descname">FTP_TLS</code><span class="sig-paren">(</span><em>host=None</em>, <em>ssl_ctx=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ftpslib.html#FTP_TLS"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ftpslib.FTP_TLS" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ftplib.FTP</span></code></p> -<p>Python OO interface to client-side FTP/TLS.</p> -<dl class="method"> -<dt id="M2Crypto.ftpslib.FTP_TLS.auth_ssl"> -<code class="descname">auth_ssl</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ftpslib.html#FTP_TLS.auth_ssl"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ftpslib.FTP_TLS.auth_ssl" title="Permalink to this definition">¶</a></dt> -<dd><p>Secure the control connection per AUTH SSL, aka AUTH TLS-P.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ftpslib.FTP_TLS.auth_tls"> -<code class="descname">auth_tls</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ftpslib.html#FTP_TLS.auth_tls"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ftpslib.FTP_TLS.auth_tls" title="Permalink to this definition">¶</a></dt> -<dd><p>Secure the control connection per AUTH TLS, aka AUTH TLS-C.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ftpslib.FTP_TLS.ntransfercmd"> -<code class="descname">ntransfercmd</code><span class="sig-paren">(</span><em>cmd</em>, <em>rest=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ftpslib.html#FTP_TLS.ntransfercmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ftpslib.FTP_TLS.ntransfercmd" title="Permalink to this definition">¶</a></dt> -<dd><p>Initiate a data transfer.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ftpslib.FTP_TLS.prot_c"> -<code class="descname">prot_c</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ftpslib.html#FTP_TLS.prot_c"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ftpslib.FTP_TLS.prot_c" title="Permalink to this definition">¶</a></dt> -<dd><p>Set up data connection in the clear.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.ftpslib.FTP_TLS.prot_p"> -<code class="descname">prot_p</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/ftpslib.html#FTP_TLS.prot_p"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.ftpslib.FTP_TLS.prot_p" title="Permalink to this definition">¶</a></dt> -<dd><p>Set up secure data connection.</p> -</dd></dl> - -</dd></dl> - +<div class="section" id="ftpslib-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">ftpslib</span></code> Module<a class="headerlink" href="#ftpslib-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.httpslib"> -<span id="httpslib-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">httpslib</span></code> Module<a class="headerlink" href="#module-M2Crypto.httpslib" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.httpslib.HTTPSConnection"> -<em class="property">class </em><code class="descclassname">M2Crypto.httpslib.</code><code class="descname">HTTPSConnection</code><span class="sig-paren">(</span><em>host</em>, <em>port=None</em>, <em>strict=None</em>, <em>**ssl</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#HTTPSConnection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.HTTPSConnection" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">http.client.HTTPConnection</span></code></p> -<p>This class allows communication via SSL using M2Crypto.</p> -<dl class="method"> -<dt id="M2Crypto.httpslib.HTTPSConnection.close"> -<code class="descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#HTTPSConnection.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.HTTPSConnection.close" title="Permalink to this definition">¶</a></dt> -<dd><p>Close the connection to the HTTP server.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.httpslib.HTTPSConnection.connect"> -<code class="descname">connect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#HTTPSConnection.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.HTTPSConnection.connect" title="Permalink to this definition">¶</a></dt> -<dd><p>Connect to the host and port specified in __init__.</p> -</dd></dl> - -<dl class="attribute"> -<dt id="M2Crypto.httpslib.HTTPSConnection.default_port"> -<code class="descname">default_port</code><em class="property"> = 443</em><a class="headerlink" href="#M2Crypto.httpslib.HTTPSConnection.default_port" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.httpslib.HTTPSConnection.get_session"> -<code class="descname">get_session</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#HTTPSConnection.get_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.HTTPSConnection.get_session" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="method"> -<dt id="M2Crypto.httpslib.HTTPSConnection.set_session"> -<code class="descname">set_session</code><span class="sig-paren">(</span><em>session</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#HTTPSConnection.set_session"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.HTTPSConnection.set_session" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="class"> -<dt id="M2Crypto.httpslib.ProxyHTTPSConnection"> -<em class="property">class </em><code class="descclassname">M2Crypto.httpslib.</code><code class="descname">ProxyHTTPSConnection</code><span class="sig-paren">(</span><em>host</em>, <em>port=None</em>, <em>strict=None</em>, <em>username=None</em>, <em>password=None</em>, <em>**ssl</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#ProxyHTTPSConnection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.ProxyHTTPSConnection" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <a class="reference internal" href="#M2Crypto.httpslib.HTTPSConnection" title="M2Crypto.httpslib.HTTPSConnection"><code class="xref py py-class docutils literal notranslate"><span class="pre">M2Crypto.httpslib.HTTPSConnection</span></code></a></p> -<p>An HTTPS Connection that uses a proxy and the CONNECT request.</p> -<p>When the connection is initiated, CONNECT is first sent to the proxy (along -with authorization headers, if supplied). If successful, an SSL connection -will be established over the socket through the proxy and to the target -host.</p> -<p>Finally, the actual request is sent over the SSL connection tunneling -through the proxy.</p> -<dl class="method"> -<dt id="M2Crypto.httpslib.ProxyHTTPSConnection.connect"> -<code class="descname">connect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#ProxyHTTPSConnection.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.ProxyHTTPSConnection.connect" title="Permalink to this definition">¶</a></dt> -<dd><p>Connect to the host and port specified in __init__.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.httpslib.ProxyHTTPSConnection.endheaders"> -<code class="descname">endheaders</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#ProxyHTTPSConnection.endheaders"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.ProxyHTTPSConnection.endheaders" title="Permalink to this definition">¶</a></dt> -<dd><p>Indicate that the last header line has been sent to the server.</p> -<p>This method sends the request to the server. The optional message_body -argument can be used to pass a message body associated with the -request.</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.httpslib.ProxyHTTPSConnection.putheader"> -<code class="descname">putheader</code><span class="sig-paren">(</span><em>header</em>, <em>value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#ProxyHTTPSConnection.putheader"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.ProxyHTTPSConnection.putheader" title="Permalink to this definition">¶</a></dt> -<dd><p>Send a request header line to the server.</p> -<p>For example: h.putheader(‘Accept’, ‘text/html’)</p> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.httpslib.ProxyHTTPSConnection.putrequest"> -<code class="descname">putrequest</code><span class="sig-paren">(</span><em>method</em>, <em>url</em>, <em>skip_host=0</em>, <em>skip_accept_encoding=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/httpslib.html#ProxyHTTPSConnection.putrequest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.httpslib.ProxyHTTPSConnection.putrequest" title="Permalink to this definition">¶</a></dt> -<dd><p>putrequest is called before connect, so can interpret url and get -real host/port to be used to make CONNECT request to proxy</p> -</dd></dl> - -</dd></dl> - +<div class="section" id="httpslib-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">httpslib</span></code> Module<a class="headerlink" href="#httpslib-module" title="Permalink to this headline">¶</a></h2> </div> <div class="section" id="module-M2Crypto.m2"> <span id="m2-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2</span></code> Module<a class="headerlink" href="#module-M2Crypto.m2" title="Permalink to this headline">¶</a></h2> @@ -4598,151 +1127,64 @@ real host/port to be used to make CONNECT request to proxy</p> <div class="section" id="module-M2Crypto.m2crypto"> <span id="m2crypto-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2crypto</span></code> Module<a class="headerlink" href="#module-M2Crypto.m2crypto" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.m2urllib"> -<span id="m2urllib-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib</span></code> Module<a class="headerlink" href="#module-M2Crypto.m2urllib" title="Permalink to this headline">¶</a></h2> -<dl class="function"> -<dt id="M2Crypto.m2urllib.open_https"> -<code class="descclassname">M2Crypto.m2urllib.</code><code class="descname">open_https</code><span class="sig-paren">(</span><em>self</em>, <em>url</em>, <em>data=None</em>, <em>ssl_context=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/m2urllib.html#open_https"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.m2urllib.open_https" title="Permalink to this definition">¶</a></dt> -<dd><p>Open URL over the SSL connection.</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>url</strong> – URL to be opened</li> -<li><strong>data</strong> – data for the POST request</li> -<li><strong>ssl_context</strong> – SSL.Context to be used</li> -</ul> -</td> -</tr> -<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"></p> -</td> -</tr> -</tbody> -</table> -</dd></dl> - +<div class="section" id="m2urllib-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib</span></code> Module<a class="headerlink" href="#m2urllib-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.m2urllib2"> -<span id="m2urllib2-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib2</span></code> Module<a class="headerlink" href="#module-M2Crypto.m2urllib2" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.m2urllib2.HTTPSHandler"> -<em class="property">class </em><code class="descclassname">M2Crypto.m2urllib2.</code><code class="descname">HTTPSHandler</code><span class="sig-paren">(</span><em>ssl_context=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/m2urllib2.html#HTTPSHandler"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.m2urllib2.HTTPSHandler" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">urllib.request.AbstractHTTPHandler</span></code></p> -<dl class="method"> -<dt id="M2Crypto.m2urllib2.HTTPSHandler.https_open"> -<code class="descname">https_open</code><span class="sig-paren">(</span><em>req</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/m2urllib2.html#HTTPSHandler.https_open"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.m2urllib2.HTTPSHandler.https_open" title="Permalink to this definition">¶</a></dt> -<dd><p>Return an addinfourl object for the request, using http_class.</p> -<p>http_class must implement the HTTPConnection API from httplib. -The addinfourl return value is a file-like object. It also -has methods and attributes including:</p> -<blockquote> -<div><ul class="simple"> -<li>info(): return a mimetools.Message object for the headers</li> -<li>geturl(): return the original request URL</li> -<li>code: HTTP status code</li> -</ul> -</div></blockquote> -</dd></dl> - -<dl class="method"> -<dt id="M2Crypto.m2urllib2.HTTPSHandler.https_request"> -<code class="descname">https_request</code><span class="sig-paren">(</span><em>request</em><span class="sig-paren">)</span><a class="headerlink" href="#M2Crypto.m2urllib2.HTTPSHandler.https_request" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.m2urllib2.build_opener"> -<code class="descclassname">M2Crypto.m2urllib2.</code><code class="descname">build_opener</code><span class="sig-paren">(</span><em>ssl_context=None</em>, <em>*handlers</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/m2urllib2.html#build_opener"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.m2urllib2.build_opener" title="Permalink to this definition">¶</a></dt> -<dd><p>Create an opener object from a list of handlers.</p> -<p>The opener will use several default handlers, including support -for HTTP and FTP.</p> -<p>If any of the handlers passed as arguments are subclasses of the -default handlers, the default handlers will not be used.</p> -</dd></dl> - +<div class="section" id="m2urllib2-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib2</span></code> Module<a class="headerlink" href="#m2urllib2-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.m2xmlrpclib"> -<span id="m2xmlrpclib-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2xmlrpclib</span></code> Module<a class="headerlink" href="#module-M2Crypto.m2xmlrpclib" title="Permalink to this headline">¶</a></h2> -<dl class="class"> -<dt id="M2Crypto.m2xmlrpclib.SSL_Transport"> -<em class="property">class </em><code class="descclassname">M2Crypto.m2xmlrpclib.</code><code class="descname">SSL_Transport</code><span class="sig-paren">(</span><em>ssl_context=None</em>, <em>*args</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/m2xmlrpclib.html#SSL_Transport"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.m2xmlrpclib.SSL_Transport" title="Permalink to this definition">¶</a></dt> -<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">xmlrpc.client.Transport</span></code></p> -<dl class="method"> -<dt id="M2Crypto.m2xmlrpclib.SSL_Transport.request"> -<code class="descname">request</code><span class="sig-paren">(</span><em>host</em>, <em>handler</em>, <em>request_body</em>, <em>verbose=0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/m2xmlrpclib.html#SSL_Transport.request"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.m2xmlrpclib.SSL_Transport.request" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -<dl class="attribute"> -<dt id="M2Crypto.m2xmlrpclib.SSL_Transport.user_agent"> -<code class="descname">user_agent</code><em class="property"> = 'M2Crypto_XMLRPC/0.33.0 - Python-xmlrpc/3.7'</em><a class="headerlink" href="#M2Crypto.m2xmlrpclib.SSL_Transport.user_agent" title="Permalink to this definition">¶</a></dt> -<dd></dd></dl> - -</dd></dl> - +<div class="section" id="m2xmlrpclib-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2xmlrpclib</span></code> Module<a class="headerlink" href="#m2xmlrpclib-module" title="Permalink to this headline">¶</a></h2> </div> -<div class="section" id="module-M2Crypto.threading"> -<span id="threading-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">threading</span></code> Module<a class="headerlink" href="#module-M2Crypto.threading" title="Permalink to this headline">¶</a></h2> -<dl class="function"> -<dt id="M2Crypto.threading.cleanup"> -<code class="descclassname">M2Crypto.threading.</code><code class="descname">cleanup</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/threading.html#cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.threading.cleanup" title="Permalink to this definition">¶</a></dt> -<dd><p>End and cleanup threading support.</p> -</dd></dl> - -<dl class="function"> -<dt id="M2Crypto.threading.init"> -<code class="descclassname">M2Crypto.threading.</code><code class="descname">init</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/threading.html#init"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.threading.init" title="Permalink to this definition">¶</a></dt> -<dd><p>Initialize threading support.</p> -</dd></dl> - +<div class="section" id="threading-module"> +<h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">threading</span></code> Module<a class="headerlink" href="#threading-module" title="Permalink to this headline">¶</a></h2> </div> <div class="section" id="module-M2Crypto.util"> <span id="util-module"></span><h2><code class="xref py py-mod docutils literal notranslate"><span class="pre">util</span></code> Module<a class="headerlink" href="#module-M2Crypto.util" title="Permalink to this headline">¶</a></h2> -<dl class="exception"> +<dl class="py exception"> <dt id="M2Crypto.util.UtilError"> -<em class="property">exception </em><code class="descclassname">M2Crypto.util.</code><code class="descname">UtilError</code><a class="reference internal" href="_modules/M2Crypto/util.html#UtilError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.UtilError" title="Permalink to this definition">¶</a></dt> +<em class="property">exception </em><code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">UtilError</code><a class="reference internal" href="_modules/M2Crypto/util.html#UtilError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.UtilError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p> </dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.bin_to_hex"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">bin_to_hex</code><span class="sig-paren">(</span><em>b</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#bin_to_hex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.bin_to_hex" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">bin_to_hex</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">b</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/util.html#bin_to_hex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.bin_to_hex" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.genparam_callback"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">genparam_callback</code><span class="sig-paren">(</span><em>p</em>, <em>n</em>, <em>out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#genparam_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.genparam_callback" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">genparam_callback</code><span class="sig-paren">(</span><em class="sig-param">p: int</em>, <em class="sig-param">n: Any</em>, <em class="sig-param">out: io.IOBase = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/util.html#genparam_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.genparam_callback" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.no_passphrase_callback"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">no_passphrase_callback</code><span class="sig-paren">(</span><em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#no_passphrase_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.no_passphrase_callback" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">no_passphrase_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/util.html#no_passphrase_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.no_passphrase_callback" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.octx_to_num"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">octx_to_num</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#octx_to_num"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.octx_to_num" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">octx_to_num</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span><span class="p">:</span> <span class="n">bytes</span></em><span class="sig-paren">)</span> → int<a class="reference internal" href="_modules/M2Crypto/util.html#octx_to_num"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.octx_to_num" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.passphrase_callback"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">passphrase_callback</code><span class="sig-paren">(</span><em>v</em>, <em>prompt1='Enter passphrase:'</em>, <em>prompt2='Verify passphrase:'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#passphrase_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.passphrase_callback" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">passphrase_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">v</span><span class="p">:</span> <span class="n">bool</span></em>, <em class="sig-param"><span class="n">prompt1</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'Enter passphrase:'</span></em>, <em class="sig-param"><span class="n">prompt2</span><span class="p">:</span> <span class="n">str</span> <span class="o">=</span> <span class="default_value">'Verify passphrase:'</span></em><span class="sig-paren">)</span> → Optional<span class="p">[</span>str<span class="p">]</span><a class="reference internal" href="_modules/M2Crypto/util.html#passphrase_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.passphrase_callback" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.pkcs5_pad"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">pkcs5_pad</code><span class="sig-paren">(</span><em>data</em>, <em>blklen=8</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#pkcs5_pad"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.pkcs5_pad" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">pkcs5_pad</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">blklen</span><span class="p">:</span> <span class="n">int</span> <span class="o">=</span> <span class="default_value">8</span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/util.html#pkcs5_pad"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.pkcs5_pad" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.pkcs7_pad"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">pkcs7_pad</code><span class="sig-paren">(</span><em>data</em>, <em>blklen</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#pkcs7_pad"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.pkcs7_pad" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">pkcs7_pad</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span><span class="p">:</span> <span class="n">str</span></em>, <em class="sig-param"><span class="n">blklen</span><span class="p">:</span> <span class="n">int</span></em><span class="sig-paren">)</span> → str<a class="reference internal" href="_modules/M2Crypto/util.html#pkcs7_pad"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.pkcs7_pad" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> -<dl class="function"> +<dl class="py function"> <dt id="M2Crypto.util.quiet_genparam_callback"> -<code class="descclassname">M2Crypto.util.</code><code class="descname">quiet_genparam_callback</code><span class="sig-paren">(</span><em>p</em>, <em>n</em>, <em>out</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/M2Crypto/util.html#quiet_genparam_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.quiet_genparam_callback" title="Permalink to this definition">¶</a></dt> +<code class="sig-prename descclassname">M2Crypto.util.</code><code class="sig-name descname">quiet_genparam_callback</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">p</span><span class="p">:</span> <span class="n">Any</span></em>, <em class="sig-param"><span class="n">n</span><span class="p">:</span> <span class="n">Any</span></em>, <em class="sig-param"><span class="n">out</span><span class="p">:</span> <span class="n">Any</span></em><span class="sig-paren">)</span> → None<a class="reference internal" href="_modules/M2Crypto/util.html#quiet_genparam_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#M2Crypto.util.quiet_genparam_callback" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> </div> @@ -4751,17 +1193,17 @@ default handlers, the default handlers will not be used.</p> <div class="toctree-wrapper compound"> <ul> <li class="toctree-l1"><a class="reference internal" href="M2Crypto.SSL.html">SSL Package</a><ul> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#id1"><code class="docutils literal notranslate"><span class="pre">SSL</span></code> Package</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Checker"><code class="docutils literal notranslate"><span class="pre">Checker</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Cipher"><code class="docutils literal notranslate"><span class="pre">Cipher</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Connection"><code class="docutils literal notranslate"><span class="pre">Connection</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Context"><code class="docutils literal notranslate"><span class="pre">Context</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.SSLServer"><code class="docutils literal notranslate"><span class="pre">SSLServer</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Session"><code class="docutils literal notranslate"><span class="pre">Session</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.TwistedProtocolWrapper"><code class="docutils literal notranslate"><span class="pre">TwistedProtocolWrapper</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.cb"><code class="docutils literal notranslate"><span class="pre">cb</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.ssl_dispatcher"><code class="docutils literal notranslate"><span class="pre">ssl_dispatcher</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.timeout"><code class="docutils literal notranslate"><span class="pre">timeout</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#id1"><code class="xref py py-mod docutils literal notranslate"><span class="pre">SSL</span></code> Package</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#checker-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Checker</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Cipher"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Cipher</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#connection-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Connection</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Context"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Context</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#sslserver-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">SSLServer</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.Session"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Session</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#twistedprotocolwrapper-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">TwistedProtocolWrapper</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#module-M2Crypto.SSL.cb"><code class="xref py py-mod docutils literal notranslate"><span class="pre">cb</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#ssl-dispatcher-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ssl_dispatcher</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="M2Crypto.SSL.html#timeout-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">timeout</span></code> Module</a></li> </ul> </li> </ul> @@ -4788,32 +1230,32 @@ default handlers, the default handlers will not be used.</p> <h3>Navigation</h3> <ul class="current"> <li class="toctree-l1 current"><a class="current reference internal" href="#">M2Crypto Package</a><ul> -<li class="toctree-l2"><a class="reference internal" href="#id1"><code class="docutils literal notranslate"><span class="pre">M2Crypto</span></code> Package</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.ASN1"><code class="docutils literal notranslate"><span class="pre">ASN1</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.AuthCookie"><code class="docutils literal notranslate"><span class="pre">AuthCookie</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.BIO"><code class="docutils literal notranslate"><span class="pre">BIO</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.BN"><code class="docutils literal notranslate"><span class="pre">BN</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.DH"><code class="docutils literal notranslate"><span class="pre">DH</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.DSA"><code class="docutils literal notranslate"><span class="pre">DSA</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.EC"><code class="docutils literal notranslate"><span class="pre">EC</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.EVP"><code class="docutils literal notranslate"><span class="pre">EVP</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.Engine"><code class="docutils literal notranslate"><span class="pre">Engine</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.Err"><code class="docutils literal notranslate"><span class="pre">Err</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.RC4"><code class="docutils literal notranslate"><span class="pre">RC4</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.RSA"><code class="docutils literal notranslate"><span class="pre">RSA</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.Rand"><code class="docutils literal notranslate"><span class="pre">Rand</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.SMIME"><code class="docutils literal notranslate"><span class="pre">SMIME</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.X509"><code class="docutils literal notranslate"><span class="pre">X509</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.callback"><code class="docutils literal notranslate"><span class="pre">callback</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.ftpslib"><code class="docutils literal notranslate"><span class="pre">ftpslib</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.httpslib"><code class="docutils literal notranslate"><span class="pre">httpslib</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2"><code class="docutils literal notranslate"><span class="pre">m2</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2crypto"><code class="docutils literal notranslate"><span class="pre">m2crypto</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2urllib"><code class="docutils literal notranslate"><span class="pre">m2urllib</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2urllib2"><code class="docutils literal notranslate"><span class="pre">m2urllib2</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2xmlrpclib"><code class="docutils literal notranslate"><span class="pre">m2xmlrpclib</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.threading"><code class="docutils literal notranslate"><span class="pre">threading</span></code> Module</a></li> -<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.util"><code class="docutils literal notranslate"><span class="pre">util</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#id1"><code class="xref py py-mod docutils literal notranslate"><span class="pre">M2Crypto</span></code> Package</a></li> +<li class="toctree-l2"><a class="reference internal" href="#asn1-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ASN1</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#authcookie-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">AuthCookie</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#bio-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">BIO</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#bn-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">BN</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#dh-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">DH</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#dsa-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">DSA</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#ec-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">EC</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.EVP"><code class="xref py py-mod docutils literal notranslate"><span class="pre">EVP</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#engine-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Engine</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.Err"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Err</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#rc4-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">RC4</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.RSA"><code class="xref py py-mod docutils literal notranslate"><span class="pre">RSA</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#rand-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">Rand</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#smime-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">SMIME</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#x509-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">X509</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#callback-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">callback</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#ftpslib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ftpslib</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#httpslib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">httpslib</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.m2crypto"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2crypto</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#m2urllib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#m2urllib2-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2urllib2</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#m2xmlrpclib-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">m2xmlrpclib</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#threading-module"><code class="xref py py-mod docutils literal notranslate"><span class="pre">threading</span></code> Module</a></li> +<li class="toctree-l2"><a class="reference internal" href="#module-M2Crypto.util"><code class="xref py py-mod docutils literal notranslate"><span class="pre">util</span></code> Module</a></li> <li class="toctree-l2"><a class="reference internal" href="#subpackages">Subpackages</a><ul> <li class="toctree-l3"><a class="reference internal" href="M2Crypto.SSL.html">SSL Package</a></li> </ul> @@ -4832,17 +1274,15 @@ default handlers, the default handlers will not be used.</p> </ul> </div> <div id="searchbox" style="display: none" role="search"> - <h3>Quick search</h3> + <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="search.html" method="get"> - <input type="text" name="q" /> + <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> </form> </div> </div> -<script type="text/javascript">$('#searchbox').show(0);</script> +<script>$('#searchbox').show(0);</script> @@ -4859,7 +1299,7 @@ default handlers, the default handlers will not be used.</p> ©2017, Matej Cepl <mcepl@cepl.eu>. | - Powered by <a href="http://sphinx-doc.org/">Sphinx 1.8.5</a> + Powered by <a href="http://sphinx-doc.org/">Sphinx 3.2.1</a> & <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a> | |