<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'function.openssl-pkcs12-export-to-file.php',
    1 => 'openssl_pkcs12_export_to_file',
    2 => 'Exporta un certificado compatible con PKCS#12',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'Funciones de OpenSSL',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-pkcs12-export.php',
    1 => 'openssl_pkcs12_export',
  ),
  'next' => 
  array (
    0 => 'function.openssl-pkcs12-read.php',
    1 => 'openssl_pkcs12_read',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/openssl/functions/openssl-pkcs12-export-to-file.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-to-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_pkcs12_export_to_file</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.2, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_pkcs12_export_to_file</span> &mdash; <span class="dc-title">Exporta un certificado compatible con <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.openssl-pkcs12-export-to-file-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_pkcs12_export_to_file</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">$output_filename</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_to_file()</strong></span> almacena un certificado
   <code class="parameter">certificate</code> en un fichero denominado
   <code class="parameter">output_filename</code> en un formato de fichero <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkcs12-export-to-file-parameters">
  <h3 class="title">Parámetros</h3>
  <p class="para">
   <dl>
    
<dt><code class="parameter">x509</code></dt>
<dd>
    <p class="para">
        Ver los <a href="openssl.certparams.php" class="link">parámetros clave/Certificados</a>
        para una lista de valores válidos.
    </p>
</dd>

    
     <dt><code class="parameter">output_filename</code></dt>
     <dd>
      <p class="para">
       Ruta de acceso al fichero de salida.
      </p>
     </dd>
    
    
     <dt><code class="parameter">private_key</code></dt>
     <dd>
      <p class="para">
       Clave privada del fichero <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12.
       Ver <a href="openssl.certparams.php" class="link">parámetros Clave/Certificado</a>
       para una lista de valores válidos.
      </p>
     </dd>
    
    
     <dt><code class="parameter">passphrase</code></dt>
     <dd>
      <p class="para">
       Contraseña de cifrado para desbloquear el fichero <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12.
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       Array opcional, las demás claves serán ignoradas.
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Clave</th>
           <th>Descripción</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><code class="literal">&quot;extracerts&quot;</code></td>
           <td>
            array de certificados adicionales o un certificado único a incluir
            en el fichero <abbr title="Public Key Cryptography Standards">PKCS</abbr>#12.</td>
          </tr>

          <tr>
           <td><code class="literal">&quot;friendly_name&quot;</code></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span> a utilizar para el certificado y la clave proporcionados</td>
          </tr>

         </tbody>
        
       </table>

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


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkcs12-export-to-file-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   Esta función retorna <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en caso de éxito o <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si ocurre un error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openssl-pkcs12-export-to-file-changelog">
  <h3 class="title">Historial de cambios</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versión</th>
      <th>Descripción</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">certificate</code> ahora acepta una instancia de
       <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> ;
       anteriormente, se aceptaba un <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> de tipo <code class="literal">OpenSSL X.509 CSR</code>.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">private_key</code> ahora acepta una instancia de
       <span class="classname"><a href="class.opensslasymmetrickey.php" class="classname">OpenSSLAsymmetricKey</a></span> o <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> ;
       anteriormente, se aceptaba un <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> de tipo <code class="literal">OpenSSL key</code> o <code class="literal">OpenSSL X.509</code>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


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