function.openssl-x509-checkpurpose.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 180 行

HTML
180
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Verifies if a certificate can be used for a particular purpose</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-x509-check-private-key.html">openssl_x509_check_private_key</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-x509-export-to-file.html">openssl_x509_export_to_file</a></div> <div class="up"><a href="ref.openssl.html">OpenSSL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.openssl-x509-checkpurpose" class="refentry"> <div class="refnamediv">  <h1 class="refname">openssl_x509_checkpurpose</h1>  <p class="verinfo">(PHP 4 &gt;= 4.0.6, PHP 5)</p><p class="refpurpose"><span class="refname">openssl_x509_checkpurpose</span> &mdash; <span class="dc-title">Verifies if a certificate can be used for a particular purpose</span></p> </div>  <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">int</span> <span class="methodname"><b><b>openssl_x509_checkpurpose</b></b></span>    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter">$x509cert</tt></span>   , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$purpose</tt></span>   [, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$cainfo</tt></span>   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$untrustedfile</tt></span>  ]] )</div>  <p class="para rdfs-comment">   <b>openssl_x509_checkpurpose()</b> examines a certificate to   see if it can be used for the specified <i><tt class="parameter">purpose</tt></i>.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">x509cert</tt></i></span>     <dd>      <p class="para">       The examined certificate.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">purpose</tt></i></span>     <dd>      <p class="para">       <table border="5">        <caption><b><b>openssl_x509_checkpurpose()</b> purposes</b></caption>        <colgroup>         <thead valign="middle">          <tr valign="middle">           <th colspan="1">Constant</th>           <th colspan="1">Description</th>          </tr>         </thead>         <tbody valign="middle" class="tbody">          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_SSL_CLIENT</td>           <td colspan="1" rowspan="1" align="left">Can the certificate be used for the client side of an SSL           connection?</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_SSL_SERVER</td>           <td colspan="1" rowspan="1" align="left">Can the certificate be used for the server side of an SSL           connection?</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_NS_SSL_SERVER</td>           <td colspan="1" rowspan="1" align="left">Can the cert be used for Netscape SSL server?</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_SMIME_SIGN</td>           <td colspan="1" rowspan="1" align="left">Can the cert be used to sign S/MIME email?</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_SMIME_ENCRYPT</td>           <td colspan="1" rowspan="1" align="left">Can the cert be used to encrypt S/MIME email?</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_CRL_SIGN</td>           <td colspan="1" rowspan="1" align="left">Can the cert be used to sign a certificate revocation list           (CRL)?</td>          </tr>          <tr valign="middle">           <td colspan="1" rowspan="1" align="left">X509_PURPOSE_ANY</td>           <td colspan="1" rowspan="1" align="left">Can the cert be used for Any/All purposes?</td>          </tr>         </tbody>        </colgroup>       </table>       These options are not bitfields - you may specify one only!      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">cainfo</tt></i></span>     <dd>      <p class="para">       <i><tt class="parameter">cainfo</tt></i> should be an array of trusted CA files/dirs       as described in <a href="openssl.cert.verification.html" class="link">Certificate       Verification</a>. It defaults to an empty array.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">untrustedfile</tt></i></span>     <dd>      <p class="para">       If specified, this should be the name of a PEM encoded file holding       certificates that can be used to help verify the certificate, although       no trust in placed in the certificates that come from that file.      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns <b><tt>TRUE</tt></b> if the certificate can be used for the intended purpose,   <b><tt>FALSE</tt></b> if it cannot, or -1 on error.  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-x509-check-private-key.html">openssl_x509_check_private_key</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-x509-export-to-file.html">openssl_x509_export_to_file</a></div> <div class="up"><a href="ref.openssl.html">OpenSSL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?