mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
150 lines
4.6 KiB
HTML
150 lines
4.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||
<html>
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
<title>验证是否可以为特定目的使用证书</title>
|
||
</head>
|
||
<body class="docs"><div id="layout">
|
||
<div id="layout-content"><div id="function.openssl-x509-checkpurpose" class="refentry">
|
||
<div class="refnamediv">
|
||
<h1 class="refname">openssl_x509_checkpurpose</h1>
|
||
<p class="verinfo">(PHP 4 >= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">openssl_x509_checkpurpose</span> — <span class="dc-title">验证是否可以为特定目的使用证书</span></p>
|
||
|
||
</div>
|
||
|
||
<div class="refsect1 description" id="refsect1-function.openssl-x509-checkpurpose-description">
|
||
<h3 class="title">说明</h3>
|
||
<div class="methodsynopsis dc-description">
|
||
<span class="methodname"><strong>openssl_x509_checkpurpose</strong></span>
|
||
( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$x509cert</code></span>
|
||
, <span class="methodparam"><span class="type">int</span> <code class="parameter">$purpose</code></span>
|
||
[, <span class="methodparam"><span class="type">array</span> <code class="parameter">$cainfo</code><span class="initializer"> = array()</span></span>
|
||
[, <span class="methodparam"><span class="type">string</span> <code class="parameter">$untrustedfile</code></span>
|
||
]] ) : <span class="type">int</span></div>
|
||
|
||
<p class="para rdfs-comment">
|
||
<span class="function"><strong>openssl_x509_checkpurpose()</strong></span> 检查证书以查看它是否可用于指定目的 <code class="parameter">purpose</code>.
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 parameters" id="refsect1-function.openssl-x509-checkpurpose-parameters">
|
||
<h3 class="title">参数</h3>
|
||
<p class="para">
|
||
<dl>
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">x509cert</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
被检查的证书。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">purpose</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<table class="doctable table">
|
||
<caption><strong><span class="function"><strong>openssl_x509_checkpurpose()</strong></span> 目的</strong></caption>
|
||
|
||
<thead>
|
||
<tr>
|
||
<th>常量名</th>
|
||
<th>描述</th>
|
||
</tr>
|
||
|
||
</thead>
|
||
|
||
<tbody class="tbody">
|
||
<tr>
|
||
<td>X509_PURPOSE_SSL_CLIENT</td>
|
||
<td>证书是否可以用于SSL连接的客户端?</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>X509_PURPOSE_SSL_SERVER</td>
|
||
<td>证书是否可以用于SSL连接的服务器端?</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>X509_PURPOSE_NS_SSL_SERVER</td>
|
||
<td>证书是否可以用于Netscape SSL服务器?</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>X509_PURPOSE_SMIME_SIGN</td>
|
||
<td>证书是否可以用来签名 S/MIME 邮件?</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>X509_PURPOSE_SMIME_ENCRYPT</td>
|
||
<td>正式是否可用用来加密 S/MIME 邮件?</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>X509_PURPOSE_CRL_SIGN</td>
|
||
<td>证书是否可以用来签名证书撤销列表(CRL)?</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td>X509_PURPOSE_ANY</td>
|
||
<td>证书是否可以用于任何目的?</td>
|
||
</tr>
|
||
|
||
</tbody>
|
||
|
||
</table>
|
||
|
||
这些选项不是位字段——您只能指定一个字段!
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">cainfo</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
<code class="parameter">cainfo</code> 应该是一个受信任的 CA 文件/文件夹组成的数组,如<a href="openssl.cert.verification.html" class="link">Certificate
|
||
Verification</a>所描述的一样。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
|
||
<dt>
|
||
<code class="parameter">untrustedfile</code></dt>
|
||
|
||
<dd>
|
||
|
||
<p class="para">
|
||
如果指定,这应该是PEM编码文件的名称,该文件持有证书,可以用来帮助验证证书,尽管从该文件中获得的证书不受信任。
|
||
</p>
|
||
</dd>
|
||
|
||
|
||
</dl>
|
||
|
||
</p>
|
||
</div>
|
||
|
||
|
||
<div class="refsect1 returnvalues" id="refsect1-function.openssl-x509-checkpurpose-returnvalues">
|
||
<h3 class="title">返回值</h3>
|
||
<p class="para">
|
||
如果证书可以用于预期目的,返回 <strong><code>TRUE</code></strong>,如果不行,则返回 <strong><code>FALSE</code></strong> 错误便会返回 -1。
|
||
</p>
|
||
</div>
|
||
|
||
|
||
</div></div></div></body></html> |