autodoc.git / traditional_manual / chapter_21.html

version» Context lines:

autodoc.git/traditional_manual/chapter_21.html:47769:   <dd class='body--doc'><p>This function allows self-signed certificates, and it doesn't    check that names or extensions make sense.</p>   </dd></dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>   <span class='homogen--name'><b>verify_certificate_chain</b></span>   </dt> - <dd><p><code><code class='datatype'>mapping</code> <b><span class='method'>verify_certificate_chain</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>|<code class='object unresolved'>.PKCS.Signature.Signed</code>) <code class='argument'>cert_chain</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='object unresolved'>Verifier</code>|<code class='datatype'>array</code>(<code class='object unresolved'>Verifier</code>)) <code class='argument'>authorities</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>require_trust</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>mixed</code>)|<code class='datatype'>void</code> <code class='argument'>options</code><b>)</b></code></p></dd> + <dd><p><code><code class='datatype'>mapping</code> <b><span class='method'>verify_certificate_chain</span>(</b><code class='datatype'>array</code>(<code class='datatype'>string</code>|<code class='object unresolved'>.PKCS.Signature.Signed</code>) <code class='argument'>cert_chain</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='object unresolved'>Verifier</code>|<code class='datatype'>array</code>(<code class='object unresolved'>Verifier</code>)) <code class='argument'>authorities</code>, <code class='datatype'>int</code>|<code class='datatype'>void</code> <code class='argument'>require_trust</code>, <code class='datatype'>mapping</code>(<code class='datatype'>string</code>:<code class='datatype'>mixed</code>)|<code class='object unresolved'>bool</code>|<code class='datatype'>void</code> <code class='argument'>options</code><b>)</b></code></p></dd>      <dt class='head--doc'>Description</dt>   <dd class='body--doc'><p>Decodes a certificate chain, ordered from leaf to root, and    checks the signatures. Verifies that the chain can be decoded    correctly, is unbroken, and that all certificates are in effect    (time-wise.) and allowed to sign its child certificate.</p>   <p> No verifications are done on the leaf certificate to determine    what it can and can not be used for.</p>   <p> Returns a mapping with the following contents, depending    on the verification of the certificate chain:</p>
autodoc.git/traditional_manual/chapter_21.html:47813:    certificate should be a DER-encoded certificate, or decoded as a    <code>Standards.PKCS.Signature.Signed</code> object.</p>   </dd>   <dt class='head--doc'><span id='p-authorities'></span>Parameter <code class='parameter'>authorities</code></dt>   <dd></dd><dd class='body--doc'><p>A mapping from (DER-encoded) names to verifiers.</p>   </dd>   <dt class='head--doc'><span id='p-require_trust'></span>Parameter <code class='parameter'>require_trust</code></dt>   <dd></dd><dd class='body--doc'><p>Require that the certificate be traced to an authority, even if    it is self signed.</p>   </dd> + <dt class='head--doc'><span id='p-strict'></span>Parameter <code class='parameter'>strict</code></dt> + <dd></dd><dd class='body--doc'><p>By default this function only requires that the certificates are +  in order, it ignores extra certificates we didn't need to verify +  the leaf certificate.</p> + <p> If you specify <code>strict</code>, this will change, each certificate has +  to be signed by the next in the chain.</p> + <p> Some https-servers send extraneous intermediate certificates +  that aren't used to validate the leaf certificate. So strict +  mode will be incompatible with such srevers.</p> + </dd>   <dt class='head--doc'><span id='p-options'></span>Parameter <code class='parameter'>options</code></dt>   <dd></dd><dd class='body--doc'><table class='box'><tr><td><code><code class='key'>"verifier_algorithms"</code> : <code class='datatype'>mapping</code>(<code class='object unresolved'>Standards.ASN1.Types.Identifier</code>:<code class='object unresolved'>Crypto.Hash</code>)</code></td><td><p>A mapping of verifier algorithm identifier to hash algorithm    implementation.</p>   </td></tr> -  + <tr><td><code><code class='key'>"strict"</code> : <code class='datatype'>int</code></code></td><td><p>See <code>strict</code> above.</p> + </td></tr>   </table>   </dd>   <dt class='head--doc'>See also</dt>   <dd class='body--doc'><p><code>get_algorithms()</code></p>   <p> See <code>Standards.PKCS.Certificate.get_dn_string</code> for converting the    RDN to an X500 style string.</p>   </dd></dl>   <dl><dt><h2 class='header'>Enum <b class='ms datatype'>Standards.X509.CertFailure</b></h2>   </dt><dd>   
autodoc.git/traditional_manual/chapter_21.html:47993:   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Variable</span>   <span class='homogen--name'><b>der</b></span>   </dt>   <dd><p><code><code class='datatype'>void</code> Standards.X509.TBSCertificate.<b><span class='variable'>der</span></b></code></p></dd>   </dl>         <hr />   <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>dn_str</b></span> + </dt> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>dn_str</span>(</b><code class='object unresolved'>Sequence</code> <code class='argument'>dn</code><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Try to extract a readable name from <code>dn</code>. This is one of +  commonName, organizationName or organizationUnitName. The first +  that is found is returned. Suitable for subjects and issuer +  sequences.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Variable</span>   <span class='homogen--name'><b>ext_authorityKeyIdentifier</b></span>   </dt>   <dd><p><code><code class='datatype'>bool</code> Standards.X509.TBSCertificate.<b><span class='variable'>ext_authorityKeyIdentifier</span></b></code></p></dd>      <dt class='head--doc'>Description</dt>   <dd class='body--doc'><p>Set if the certificate contains a valid authorityKeyIdentifier    extension. <b><a href='http://pike.lysator.liu.se/rfc3280.xml#4.2.1.1'>RFC 3280 section 4.2.1.1</a></b>.</p>   </dd></dl>   
autodoc.git/traditional_manual/chapter_21.html:48218:   </dt>   <dd><p><code><code class='datatype'>void</code> Standards.X509.TBSCertificate.<b><span class='variable'>issuer_id</span></b></code></p></dd>      <dt class='head--doc'>Note</dt>   <dd class='body--doc'><p>optional</p>   </dd></dl>         <hr />   <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>issuer_str</b></span> + </dt> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>issuer_str</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Return the issuer of the certificate as a human readable string. +  Mainly useful for debug.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Variable</span>   <span class='homogen--name'><b>keyinfo</b></span>   </dt>   <dd><p><code><code class='datatype'>void</code> Standards.X509.TBSCertificate.<b><span class='variable'>keyinfo</span></b></code></p></dd>   </dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Method</span>
autodoc.git/traditional_manual/chapter_21.html:48315:   </dt>   <dd><p><code><code class='datatype'>void</code> Standards.X509.TBSCertificate.<b><span class='variable'>subject_id</span></b></code></p></dd>      <dt class='head--doc'>Note</dt>   <dd class='body--doc'><p>optional</p>   </dd></dl>         <hr />   <dl class='group--doc'> + <dt class='head--type'><span class='homogen--type'>Method</span> + <span class='homogen--name'><b>subject_str</b></span> + </dt> + <dd><p><code><code class='datatype'>string</code> <b><span class='method'>subject_str</span>(</b><b>)</b></code></p></dd> +  + <dt class='head--doc'>Description</dt> + <dd class='body--doc'><p>Attempt to create a presentable string from the subject DER.</p> + </dd></dl> +  +  + <hr /> + <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Variable</span>   <span class='homogen--name'><b>validity</b></span>   </dt>   <dd><p><code><code class='datatype'>void</code> Standards.X509.TBSCertificate.<b><span class='variable'>validity</span></b></code></p></dd>   </dl>         <hr />   <dl class='group--doc'>   <dt class='head--type'><span class='homogen--type'>Variable</span>