<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.openssl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.openssl-x509-fingerprint.php',
    1 => 'openssl_x509_fingerprint',
    2 => '计算一个给定的 x.509 证书的指纹或摘要',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'OpenSSL 函数',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-x509-export-to-file.php',
    1 => 'openssl_x509_export_to_file',
  ),
  'next' => 
  array (
    0 => 'function.openssl-x509-free.php',
    1 => 'openssl_x509_free',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/openssl/functions/openssl-x509-fingerprint.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openssl-x509-fingerprint" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_x509_fingerprint</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.6.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_x509_fingerprint</span> &mdash; <span class="dc-title">计算一个给定的 x.509 证书的指纹或摘要</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.openssl-x509-fingerprint-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_x509_fingerprint</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.opensslcertificate.php" class="type OpenSSLCertificate">OpenSSLCertificate</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$certificate</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$digest_algo</code><span class="initializer"> = &quot;sha1&quot;</span></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$binary</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>openssl_x509_fingerprint()</strong></span> 返回 <code class="parameter">certificate</code> 的字符串类型的摘要。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-x509-fingerprint-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
<dt><code class="parameter">certificate</code></dt>
<dd>
 <p class="para">
  参见<a href="openssl.certparams.php" class="link">密钥／证书参数</a>以获取有效值列表。
 </p>
</dd>

    
     <dt><code class="parameter">digest_algo</code></dt>
     <dd>
      <p class="para">
       使用的摘要方法或散列算法，比如，&quot;sha256&quot;、<span class="function"><a href="function.openssl-get-md-methods.php" class="function">openssl_get_md_methods()</a></span> 摘要算法之一。
      </p>
     </dd>
    
    
     <dt><code class="parameter">binary</code></dt>
     <dd>
      <p class="para">
      设置为 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> 时，输出原始二进制数据。设置为 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> 时，输出小写的 16 进制字符串。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-x509-fingerprint-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
    将包含计算的证书指纹的字符串返回为小写 16 进制格式，除非将 <code class="parameter">binary</code> 设置为 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>，在这种情况下会返回消息摘要的原始二进制表示形式。
  </p>
  <p class="para">
    失败则返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openssl-x509-fingerprint-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">certificate</code> 现在接受 <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span>
       实例；之前接受类型 <code class="literal">OpenSSL X.509</code> 的 <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>

</div><?php manual_footer($setup); ?>