<?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-cms-verify.php',
    1 => 'openssl_cms_verify',
    2 => 'Verify a CMS signature',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'OpenSSL 函数',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-cms-sign.php',
    1 => 'openssl_cms_sign',
  ),
  'next' => 
  array (
    0 => 'function.openssl-csr-export.php',
    1 => 'openssl_csr_export',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/openssl/functions/openssl-cms-verify.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openssl-cms-verify" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_cms_verify</h1>
  <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">openssl_cms_verify</span> &mdash; <span class="dc-title">Verify a CMS signature</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.openssl-cms-verify-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_cms_verify</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$input_filename</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$certificates</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$ca_info</code><span class="initializer"> = []</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$untrusted_certificates_filename</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$content</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$pk7</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$sigfile</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$encoding</code><span class="initializer"> = <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-smime">OPENSSL_ENCODING_SMIME</a></code></strong></span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   This function verifies a CMS signature, either attached or detached, with the specified encoding.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-cms-verify-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">input_filename</code></dt>
    <dd>
     <p class="para">
      The input file.
     </p>
    </dd>
   
   
    <dt><code class="parameter">flags</code></dt>
    <dd>
     <p class="para">
      Flags to pass to <span class="function"><strong>cms_verify()</strong></span>.
     </p>
    </dd>
   
   
    <dt><code class="parameter">certificates</code></dt>
    <dd>
     <p class="para">
      A file with the signer certificate and optionally intermediate certificates.
     </p>
    </dd>
   
   
    <dt><code class="parameter">ca_info</code></dt>
    <dd>
     <p class="para">
      An array containing self-signed certificate authority certificates.
     </p>
    </dd>
   
   
    <dt><code class="parameter">untrusted_certificates_filename</code></dt>
    <dd>
     <p class="para">
      A file containing additional intermediate certificates.
     </p>
    </dd>
   
   
    <dt><code class="parameter">content</code></dt>
    <dd>
     <p class="para">
      A file pointing to the content when signatures are detached.
     </p>
    </dd>
   
   
    <dt><code class="parameter">pk7</code></dt>
    <dd>
     <p class="para">

     </p>
    </dd>
   
   
    <dt><code class="parameter">sigfile</code></dt>
    <dd>
     <p class="para">
      A file to save the signature to.
     </p>
    </dd>
   
   
    <dt><code class="parameter">encoding</code></dt>
    <dd>
     <p class="para">
      The encoding of the input file. One of <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-smime">OPENSSL_ENCODING_SMIME</a></code></strong>,
      <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-der">OPENSSL_ENCODING_DER</a></code></strong> or <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-pem">OPENSSL_ENCODING_PEM</a></code></strong>.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-cms-verify-returnvalues">
  <h3 class="title">返回值</h3>
  <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>。
  </p>
 </div>


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