<?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-pkcs12-export.php',
    1 => 'openssl_pkcs12_export',
    2 => '将 PKCS#12 兼容证书存储文件导出到变量',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'OpenSSL 函数',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-pbkdf2.php',
    1 => 'openssl_pbkdf2',
  ),
  'next' => 
  array (
    0 => 'function.openssl-pkcs12-export-to-file.php',
    1 => 'openssl_pkcs12_export_to_file',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/openssl/functions/openssl-pkcs12-export.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openssl-pkcs12-export" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_pkcs12_export</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.2, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_pkcs12_export</span> &mdash; <span class="dc-title">将 <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12 兼容证书存储文件导出到变量</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.openssl-pkcs12-export-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_pkcs12_export</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<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>,<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 reference">&$output</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.php">#[\SensitiveParameter]</a> </span><span class="type"><span class="type"><a href="class.opensslasymmetrickey.php" class="type OpenSSLAsymmetricKey">OpenSSLAsymmetricKey</a></span>|<span class="type"><a href="class.opensslcertificate.php" class="type OpenSSLCertificate">OpenSSLCertificate</a></span>|<span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$private_key</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="attribute"><a href="class.sensitiveparameter.php">#[\SensitiveParameter]</a> </span><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$passphrase</code></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">$options</code><span class="initializer"> = []</span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>openssl_pkcs12_export()</strong></span> 以 <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12 文件格式将 <code class="parameter">certificate</code> 导入到名为 <code class="parameter">output</code> 的字符串变量中。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkcs12-export-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">output</code></dt>
     <dd>
      <p class="para">
       成功，该字符串将为 <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12 格式。
      </p>
     </dd>
    
    
     <dt><code class="parameter">private_key</code></dt>
     <dd>
      <p class="para">
       <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12 文件的私钥部分file，
       参见 <a href="openssl.certparams.php" class="link">公/私钥参数</a> 获取更多可用列表。
      </p>
     </dd>
    
    
     <dt><code class="parameter">passphrase</code></dt>
     <dd>
      <p class="para">
      用来解锁 <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12 文件的解密密码。
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       可选数组，其他主键将被忽略。
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Key</th>
           <th>说明</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><code class="literal">&quot;extracerts&quot;</code></td>
           <td><abbr title="Public Key Cryptography Standards">PKCS</abbr>#12 文件中包含的额外证书或单个证书的数组。</td>
          </tr>

          <tr>
           <td><code class="literal">&quot;friendly_name&quot;</code></td>
           <td>被证书和密钥使用的字符串</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkcs12-export-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 class="refsect1 changelog" id="refsect1-function.openssl-pkcs12-export-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 CSR</code> 的 <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>。
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">private_key</code> 现在接受 <span class="classname"><a href="class.opensslasymmetrickey.php" class="classname">OpenSSLAsymmetricKey</a></span>
       或 <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> 实例；之前接受类型 <code class="literal">OpenSSL key</code>
       或 <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); ?>