Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > e4be28b383be195ff28bfce2053e734a > files > 247

python-stem-doc-1.1.0-1.fc18.noarch.rpm



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Network Status Documents &mdash; Stem 1.1.0 documentation</title>
    
    <link rel="stylesheet" href="../../_static/haiku.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/print.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.1.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/theme_extras.js"></script>
    <link rel="shortcut icon" href="../../_static/favicon.png"/>
    <link rel="top" title="Stem 1.1.0 documentation" href="../../index.html" />
    <link rel="up" title="Contents" href="../../contents.html" />
    <link rel="next" title="Router Status Entries" href="router_status_entry.html" />
    <link rel="prev" title="MicroDescriptor" href="microdescriptor.html" /> 
  </head>
  <body>
      <div class="header"><img class="rightlogo" src="../../_static/logo.png" alt="Logo"/><h1 class="heading"><a href="../../index.html">
          <span>Stem Docs</span></a></h1>
        <h2 class="heading"><span>Network Status Documents</span></h2>
      </div>
      <div class="topnav">
      
        <p>

        <ul id="navbar">
          <li><a href="../../index.html">Home</a></li>
          <li><a href="../../tutorials.html">Tutorials</a>
            <ul>
              <li><a href="../../tutorials/the_little_relay_that_could.html">Hello World</a></li>
              <li><a href="../../tutorials/to_russia_with_love.html">Client Usage</a></li>
              <li><a href="../../tutorials/tortoise_and_the_hare.html">Event Listening</a></li>
              <li><a href="../../tutorials/mirror_mirror_on_the_wall.html">Tor Descriptors</a></li>
              <li><a href="../../tutorials/east_of_the_sun.html">Utilities</a></li>
              <li><a href="../../tutorials/double_double_toil_and_trouble.html">Examples</a></li>
            </ul>
          </li>
          <li><a href="../../api.html">API</a>
            <ul>
              <li><a href="../control.html">stem.control</a></li>
              <li><a href="../connection.html">stem.connection</a></li>
              <li><a href="../socket.html">stem.socket</a></li>
              <li><a href="../process.html">stem.process</a></li>
              <li><a href="../response.html">stem.response</a></li>
              <li><a href="../exit_policy.html">stem.exit_policy</a></li>
              <li><a href="../version.html">stem.version</a></li>
              <li><a href="../../api.html#descriptors">Descriptors</a></li>
              <li><a href="../../api.html#utilities">Utilities</a></li>
            </ul>
          </li>
          <li><a href="https://trac.torproject.org/projects/tor/wiki/doc/stem">Development</a>
            <ul>
              <li><a href="../../faq.html">FAQ</a></li>
              <li><a href="../../change_log.html">Change Log</a></li>
              <li><a href="https://trac.torproject.org/projects/tor/wiki/doc/stem/bugs">Bug Tracker</a></li>
              <li><a href="../../download.html">Download</a></li>
            </ul>
          </li>
        </ul>
        </p>

      </div>
      <div class="content">
        
        
  <div class="section" id="module-stem.descriptor.networkstatus">
<span id="network-status-documents"></span><h1>Network Status Documents<a class="headerlink" href="#module-stem.descriptor.networkstatus" title="Permalink to this headline">¶</a></h1>
<p>Parsing for Tor network status documents. This supports both the v2 and v3
dir-spec. Documents can be obtained from a few sources...</p>
<ul class="simple">
<li>the &#8216;cached-consensus&#8217; file in tor&#8217;s data directory</li>
<li>tor metrics, at <a class="reference external" href="https://metrics.torproject.org/data.html">https://metrics.torproject.org/data.html</a></li>
<li>directory authorities and mirrors via their DirPort</li>
</ul>
<p>... and contain the following sections...</p>
<ul class="simple">
<li>document header</li>
<li>list of <a class="reference internal" href="#stem.descriptor.networkstatus.DirectoryAuthority" title="stem.descriptor.networkstatus.DirectoryAuthority"><tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.networkstatus.DirectoryAuthority</span></tt></a></li>
<li>list of <a class="reference internal" href="router_status_entry.html#stem.descriptor.router_status_entry.RouterStatusEntry" title="stem.descriptor.router_status_entry.RouterStatusEntry"><tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.router_status_entry.RouterStatusEntry</span></tt></a></li>
<li>document footer</li>
</ul>
<p>Of these, the router status entry section can be quite large (on the order of
hundreds of kilobytes). As such we provide a couple of methods for reading
network status documents through <a class="reference internal" href="descriptor.html#stem.descriptor.__init__.parse_file" title="stem.descriptor.__init__.parse_file"><tt class="xref py py-func docutils literal"><span class="pre">parse_file()</span></tt></a>.
For more information see <a class="reference internal" href="descriptor.html#stem.descriptor.__init__.DocumentHandler" title="stem.descriptor.__init__.DocumentHandler"><tt class="xref py py-func docutils literal"><span class="pre">DocumentHandler()</span></tt></a>...</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">stem.descriptor</span> <span class="kn">import</span> <span class="n">parse_file</span><span class="p">,</span> <span class="n">DocumentHandler</span>

<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s">&#39;.tor/cached-consensus&#39;</span><span class="p">,</span> <span class="s">&#39;rb&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">consensus_file</span><span class="p">:</span>
  <span class="c"># Processes the routers as we read them in. The routers refer to a document</span>
  <span class="c"># with an unset &#39;routers&#39; attribute.</span>

  <span class="k">for</span> <span class="n">router</span> <span class="ow">in</span> <span class="n">parse_file</span><span class="p">(</span><span class="n">consensus_file</span><span class="p">,</span> <span class="s">&#39;network-status-consensus-3 1.0&#39;</span><span class="p">,</span> <span class="n">document_handler</span> <span class="o">=</span> <span class="n">DocumentHandler</span><span class="o">.</span><span class="n">ENTRIES</span><span class="p">):</span>
    <span class="k">print</span> <span class="n">router</span><span class="o">.</span><span class="n">nickname</span>
</pre></div>
</div>
<p><strong>Module Overview:</strong></p>
<div class="highlight-python"><pre>NetworkStatusDocument - Network status document
  |- NetworkStatusDocumentV2 - Version 2 network status document
  |- NetworkStatusDocumentV3 - Version 3 network status document
  +- BridgeNetworkStatusDocument - Version 3 network status document for bridges

KeyCertificate - Certificate used to authenticate an authority
DocumentSignature - Signature of a document by a directory authority
DirectoryAuthority - Directory authority as defined in a v3 network status document</pre>
</div>
<dl class="class">
<dt id="stem.descriptor.networkstatus.NetworkStatusDocument">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">NetworkStatusDocument</tt><big>(</big><em>raw_content</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#NetworkStatusDocument"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.NetworkStatusDocument" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.Descriptor</span></tt></p>
<p>Common parent for network status documents.</p>
<dl class="method">
<dt id="stem.descriptor.networkstatus.NetworkStatusDocument.get_unrecognized_lines">
<tt class="descname">get_unrecognized_lines</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#NetworkStatusDocument.get_unrecognized_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.NetworkStatusDocument.get_unrecognized_lines" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="stem.descriptor.networkstatus.NetworkStatusDocumentV2">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">NetworkStatusDocumentV2</tt><big>(</big><em>raw_content</em>, <em>validate=True</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#NetworkStatusDocumentV2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.NetworkStatusDocumentV2" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#stem.descriptor.networkstatus.NetworkStatusDocument" title="stem.descriptor.networkstatus.NetworkStatusDocument"><tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.networkstatus.NetworkStatusDocument</span></tt></a></p>
<p>Version 2 network status document. These have been deprecated and are no
longer generated by Tor.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>routers</strong> (<em>dict</em>) &#8211; fingerprints to <a class="reference internal" href="router_status_entry.html#stem.descriptor.router_status_entry.RouterStatusEntryV2" title="stem.descriptor.router_status_entry.RouterStatusEntryV2"><tt class="xref py py-class docutils literal"><span class="pre">RouterStatusEntryV2</span></tt></a>
contained in the document</li>
<li><strong>version</strong> (<em>int</em>) &#8211; <strong>*</strong> document version</li>
<li><strong>hostname</strong> (<em>str</em>) &#8211; <strong>*</strong> hostname of the authority</li>
<li><strong>address</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s IP address</li>
<li><strong>dir_port</strong> (<em>int</em>) &#8211; <strong>*</strong> authority&#8217;s DirPort</li>
<li><strong>fingerprint</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s fingerprint</li>
<li><strong>contact</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s contact information</li>
<li><strong>signing_key</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s public signing key</li>
<li><strong>client_versions</strong> (<em>list</em>) &#8211; list of recommended client tor version strings</li>
<li><strong>server_versions</strong> (<em>list</em>) &#8211; list of recommended server tor version strings</li>
<li><strong>published</strong> (<em>datetime</em>) &#8211; <strong>*</strong> time when the document was published</li>
<li><strong>options</strong> (<em>list</em>) &#8211; <strong>*</strong> list of things that this authority decides</li>
<li><strong>signing_authority</strong> (<em>str</em>) &#8211; <strong>*</strong> name of the authority signing the document</li>
<li><strong>signature</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s signature for the document</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>*</strong> attribute is either required when we&#8217;re parsed with validation or has
a default value, others are left as <strong>None</strong> if undefined</p>
</dd></dl>

<dl class="class">
<dt id="stem.descriptor.networkstatus.NetworkStatusDocumentV3">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">NetworkStatusDocumentV3</tt><big>(</big><em>raw_content</em>, <em>validate=True</em>, <em>default_params=True</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#NetworkStatusDocumentV3"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.NetworkStatusDocumentV3" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#stem.descriptor.networkstatus.NetworkStatusDocument" title="stem.descriptor.networkstatus.NetworkStatusDocument"><tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.networkstatus.NetworkStatusDocument</span></tt></a></p>
<p>Version 3 network status document. This could be either a vote or consensus.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>routers</strong> (<em>tuple</em>) &#8211; <a class="reference internal" href="router_status_entry.html#stem.descriptor.router_status_entry.RouterStatusEntryV3" title="stem.descriptor.router_status_entry.RouterStatusEntryV3"><tt class="xref py py-class docutils literal"><span class="pre">RouterStatusEntryV3</span></tt></a>
contained in the document</li>
<li><strong>version</strong> (<em>int</em>) &#8211; <strong>*</strong> document version</li>
<li><strong>version_flavor</strong> (<em>str</em>) &#8211; <strong>*</strong> flavor associated with the document (such as &#8216;microdesc&#8217;)</li>
<li><strong>is_consensus</strong> (<em>bool</em>) &#8211; <strong>*</strong> <strong>True</strong> if the document is a consensus</li>
<li><strong>is_vote</strong> (<em>bool</em>) &#8211; <strong>*</strong> <strong>True</strong> if the document is a vote</li>
<li><strong>is_microdescriptor</strong> (<em>bool</em>) &#8211; <strong>*</strong> <strong>True</strong> if this is a microdescriptor
flavored document, <strong>False</strong> otherwise</li>
<li><strong>valid_after</strong> (<em>datetime</em>) &#8211; <strong>*</strong> time when the consensus became valid</li>
<li><strong>fresh_until</strong> (<em>datetime</em>) &#8211; <strong>*</strong> time when the next consensus should be produced</li>
<li><strong>valid_until</strong> (<em>datetime</em>) &#8211; <strong>*</strong> time when this consensus becomes obsolete</li>
<li><strong>vote_delay</strong> (<em>int</em>) &#8211; <strong>*</strong> number of seconds allowed for collecting votes
from all authorities</li>
<li><strong>dist_delay</strong> (<em>int</em>) &#8211; <strong>*</strong> number of seconds allowed for collecting
signatures from all authorities</li>
<li><strong>client_versions</strong> (<em>list</em>) &#8211; list of recommended client tor versions</li>
<li><strong>server_versions</strong> (<em>list</em>) &#8211; list of recommended server tor versions</li>
<li><strong>known_flags</strong> (<em>list</em>) &#8211; <strong>*</strong> list of <a class="reference internal" href="../control.html#stem.Flag" title="stem.Flag"><tt class="xref py py-data docutils literal"><span class="pre">Flag</span></tt></a> for the router&#8217;s flags</li>
<li><strong>params</strong> (<em>dict</em>) &#8211; <strong>*</strong> dict of parameter(<strong>str</strong>) =&gt; value(<strong>int</strong>) mappings</li>
<li><strong>directory_authorities</strong> (<em>list</em>) &#8211; <strong>*</strong> list of <a class="reference internal" href="#stem.descriptor.networkstatus.DirectoryAuthority" title="stem.descriptor.networkstatus.DirectoryAuthority"><tt class="xref py py-class docutils literal"><span class="pre">DirectoryAuthority</span></tt></a>
objects that have generated this document</li>
<li><strong>signatures</strong> (<em>list</em>) &#8211; <strong>*</strong> <a class="reference internal" href="#stem.descriptor.networkstatus.DocumentSignature" title="stem.descriptor.networkstatus.DocumentSignature"><tt class="xref py py-class docutils literal"><span class="pre">DocumentSignature</span></tt></a>
of the authorities that have signed the document</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>Consensus Attributes:</strong></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>consensus_method</strong> (<em>int</em>) &#8211; method version used to generate this consensus</li>
<li><strong>bandwidth_weights</strong> (<em>dict</em>) &#8211; dict of weight(str) =&gt; value(int) mappings</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>Vote Attributes:</strong></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>consensus_methods</strong> (<em>list</em>) &#8211; list of ints for the supported method versions</li>
<li><strong>published</strong> (<em>datetime</em>) &#8211; time when the document was published</li>
<li><strong>flag_thresholds</strong> (<em>dict</em>) &#8211; <strong>*</strong> mapping of internal performance thresholds used while making the vote, values are <strong>ints</strong> or <strong>floats</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>*</strong> attribute is either required when we&#8217;re parsed with validation or has
a default value, others are left as None if undefined</p>
<dl class="method">
<dt id="stem.descriptor.networkstatus.NetworkStatusDocumentV3.meets_consensus_method">
<tt class="descname">meets_consensus_method</tt><big>(</big><em>method</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#NetworkStatusDocumentV3.meets_consensus_method"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.NetworkStatusDocumentV3.meets_consensus_method" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if we meet the given consensus-method. This works for both votes and
consensuses, checking our &#8216;consensus-method&#8217; and &#8216;consensus-methods&#8217;
entries.</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>method</strong> (<em>int</em>) &#8211; consensus-method to check for</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>True</strong> if we meet the given consensus-method, and <strong>False</strong> otherwise</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="stem.descriptor.networkstatus.DirectoryAuthority">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">DirectoryAuthority</tt><big>(</big><em>raw_content</em>, <em>validate=True</em>, <em>is_vote=False</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#DirectoryAuthority"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.DirectoryAuthority" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.Descriptor</span></tt></p>
<p>Directory authority information obtained from a v3 network status document.</p>
<p>Authorities can optionally use a legacy format. These are no longer found in
practice, but have the following differences...</p>
<ul class="simple">
<li>The authority&#8217;s nickname ends with &#8216;-legacy&#8217;.</li>
<li>There&#8217;s no <strong>contact</strong> or <strong>vote_digest</strong> attribute.</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>nickname</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s nickname</li>
<li><strong>fingerprint</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s fingerprint</li>
<li><strong>hostname</strong> (<em>str</em>) &#8211; <strong>*</strong> hostname of the authority</li>
<li><strong>address</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s IP address</li>
<li><strong>dir_port</strong> (<em>int</em>) &#8211; <strong>*</strong> authority&#8217;s DirPort</li>
<li><strong>or_port</strong> (<em>int</em>) &#8211; <strong>*</strong> authority&#8217;s ORPort</li>
<li><strong>is_legacy</strong> (<em>bool</em>) &#8211; <strong>*</strong> if the authority&#8217;s using the legacy format</li>
<li><strong>contact</strong> (<em>str</em>) &#8211; contact information, this is included if is_legacy is <strong>False</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>Consensus Attributes:</strong></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><strong>vote_digest</strong> (<em>str</em>) &#8211; digest of the authority that contributed to the consensus, this is included if is_legacy is <strong>False</strong></td>
</tr>
</tbody>
</table>
<p><strong>Vote Attributes:</strong></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>legacy_dir_key</strong> (<em>str</em>) &#8211; fingerprint of and obsolete identity key</li>
<li><strong>key_certificate</strong> (<a class="reference internal" href="#stem.descriptor.networkstatus.KeyCertificate" title="stem.descriptor.networkstatus.KeyCertificate"><em>stem.descriptor.networkstatus.KeyCertificate</em></a>) &#8211; <strong>*</strong>
authority&#8217;s key certificate</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>*</strong> mandatory attribute</p>
<dl class="method">
<dt id="stem.descriptor.networkstatus.DirectoryAuthority.get_unrecognized_lines">
<tt class="descname">get_unrecognized_lines</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#DirectoryAuthority.get_unrecognized_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.DirectoryAuthority.get_unrecognized_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns any unrecognized lines.</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">a list of unrecognized lines</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="stem.descriptor.networkstatus.KeyCertificate">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">KeyCertificate</tt><big>(</big><em>raw_content</em>, <em>validate=True</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#KeyCertificate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.KeyCertificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.Descriptor</span></tt></p>
<p>Directory key certificate for a v3 network status document.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>version</strong> (<em>int</em>) &#8211; <strong>*</strong> version of the key certificate</li>
<li><strong>address</strong> (<em>str</em>) &#8211; authority&#8217;s IP address</li>
<li><strong>dir_port</strong> (<em>int</em>) &#8211; authority&#8217;s DirPort</li>
<li><strong>fingerprint</strong> (<em>str</em>) &#8211; <strong>*</strong> authority&#8217;s fingerprint</li>
<li><strong>identity_key</strong> (<em>str</em>) &#8211; <strong>*</strong> long term authority identity key</li>
<li><strong>published</strong> (<em>datetime</em>) &#8211; <strong>*</strong> time when this key was generated</li>
<li><strong>expires</strong> (<em>datetime</em>) &#8211; <strong>*</strong> time after which this key becomes invalid</li>
<li><strong>signing_key</strong> (<em>str</em>) &#8211; <strong>*</strong> directory server&#8217;s public signing key</li>
<li><strong>crosscert</strong> (<em>str</em>) &#8211; signature made using certificate&#8217;s signing key</li>
<li><strong>certification</strong> (<em>str</em>) &#8211; <strong>*</strong> signature of this key certificate signed with
the identity key</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p><strong>*</strong> mandatory attribute</p>
<dl class="method">
<dt id="stem.descriptor.networkstatus.KeyCertificate.get_unrecognized_lines">
<tt class="descname">get_unrecognized_lines</tt><big>(</big><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#KeyCertificate.get_unrecognized_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.KeyCertificate.get_unrecognized_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns any unrecognized lines.</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"><strong>list</strong> of unrecognized lines</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="stem.descriptor.networkstatus.DocumentSignature">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">DocumentSignature</tt><big>(</big><em>method</em>, <em>identity</em>, <em>key_digest</em>, <em>signature</em>, <em>validate=True</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#DocumentSignature"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.DocumentSignature" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Directory signature of a v3 network status document.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first simple">
<li><strong>method</strong> (<em>str</em>) &#8211; algorithm used to make the signature</li>
<li><strong>identity</strong> (<em>str</em>) &#8211; fingerprint of the authority that made the signature</li>
<li><strong>key_digest</strong> (<em>str</em>) &#8211; digest of the signing key</li>
<li><strong>signature</strong> (<em>str</em>) &#8211; document signature</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>validate</strong> (<em>bool</em>) &#8211; checks validity if <strong>True</strong></p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises :</th><td class="field-body"><p class="first last"><strong>ValueError</strong> if a validity check fails</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="class">
<dt id="stem.descriptor.networkstatus.BridgeNetworkStatusDocument">
<em class="property">class </em><tt class="descclassname">stem.descriptor.networkstatus.</tt><tt class="descname">BridgeNetworkStatusDocument</tt><big>(</big><em>raw_content</em>, <em>validate=True</em><big>)</big><a class="reference internal" href="../../_modules/stem/descriptor/networkstatus.html#BridgeNetworkStatusDocument"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#stem.descriptor.networkstatus.BridgeNetworkStatusDocument" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#stem.descriptor.networkstatus.NetworkStatusDocument" title="stem.descriptor.networkstatus.NetworkStatusDocument"><tt class="xref py py-class docutils literal"><span class="pre">stem.descriptor.networkstatus.NetworkStatusDocument</span></tt></a></p>
<p>Network status document containing bridges. This is only available through
the metrics site.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
<li><strong>routers</strong> (<em>tuple</em>) &#8211; <a class="reference internal" href="router_status_entry.html#stem.descriptor.router_status_entry.RouterStatusEntryV2" title="stem.descriptor.router_status_entry.RouterStatusEntryV2"><tt class="xref py py-class docutils literal"><span class="pre">RouterStatusEntryV2</span></tt></a>
contained in the document</li>
<li><strong>published</strong> (<em>datetime</em>) &#8211; time when the document was published</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>


      </div>
      <div class="bottomnav">
      </div>

    <div class="footer">
    </div>
  </body>
</html>