<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.openssl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'openssl.certparams.php',
    1 => 'Key/Certificate parameters',
    2 => 'Key/Certificate parameters',
  ),
  'up' => 
  array (
    0 => 'book.openssl.php',
    1 => 'OpenSSL',
  ),
  'prev' => 
  array (
    0 => 'openssl.constants.other.php',
    1 => 'Other Constants',
  ),
  'next' => 
  array (
    0 => 'openssl.cert.verification.php',
    1 => 'Certificate Verification',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/openssl/certparams.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="openssl.certparams" class="appendix">
 <h1 class="title">Key/Certificate parameters</h1>

 <p class="para">
  Quite a few of the openssl functions require a key or a certificate
  parameter. Following methods may be used to get them:
  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     Certificates
     <ol type="1">
      <li class="listitem">
       <span class="simpara">
        An <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> instance
        (or prior to PHP 8.0.0, a <a href="language.types.resource.php" class="link">resource</a> of type <code class="literal">OpenSSL X.509</code>)
        returned from <span class="function"><a href="function.openssl-x509-read.php" class="function">openssl_x509_read()</a></span>
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">A string having the format
        <var class="filename">file://path/to/cert.pem</var>; the named file must
        contain a <abbr title="Privacy-Enhanced Mail">PEM</abbr> encoded certificate
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        A string containing the content of a certificate, <abbr title="Privacy-Enhanced Mail">PEM</abbr>
        encoded, may start with <code class="literal">-----BEGIN CERTIFICATE-----</code>
       </span>
      </li>
     </ol>
    </p>
   </li>

   <li class="listitem">
    <p class="para">
     Certificate Signing Requests (CSRs)
     <ol type="1">
      <li class="listitem">
       <span class="simpara">
        An <span class="classname"><a href="class.opensslcertificatesigningrequest.php" class="classname">OpenSSLCertificateSigningRequest</a></span> instance
        (or prior to PHP 8.0.0, a <a href="language.types.resource.php" class="link">resource</a> of type <code class="literal">OpenSSL X.509 CSR</code>)
        returned from <span class="function"><a href="function.openssl-csr-new.php" class="function">openssl_csr_new()</a></span>
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">A string having the format
        <var class="filename">file://path/to/csr.pem</var>; the named file must
        contain a <abbr title="Privacy-Enhanced Mail">PEM</abbr> encoded <abbr title="Certificate Signing Request">CSR</abbr>
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        A string containing the content of a <abbr title="Certificate Signing Request">CSR</abbr>, <abbr title="Privacy-Enhanced Mail">PEM</abbr> encoded,
        may start with <code class="literal">-----BEGIN CERTIFICATE REQUEST-----</code>
       </span>
      </li>
     </ol>
    </p>
   </li>

   
   <li class="listitem">
    <p class="para">
     Public/Private Keys
     <ol type="1">
      <li class="listitem">
       <span class="simpara">
        An <span class="classname"><a href="class.opensslasymmetrickey.php" class="classname">OpenSSLAsymmetricKey</a></span> instance
        (or prior to PHP 8.0.0, a <a href="language.types.resource.php" class="link">resource</a> of type <code class="literal">OpenSSL key</code>)
        returned from <span class="function"><a href="function.openssl-get-publickey.php" class="function">openssl_get_publickey()</a></span> or
        <span class="function"><a href="function.openssl-get-privatekey.php" class="function">openssl_get_privatekey()</a></span>
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        For public keys only: an <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> instance
        (or prior to PHP 8.0.0, a <a href="language.types.resource.php" class="link">resource</a> of type <code class="literal">OpenSSL X.509</code>)
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">A string having the format
        <var class="filename">file://path/to/file.pem</var> - the named file must
        contain a <abbr title="Privacy-Enhanced Mail">PEM</abbr> encoded certificate/private key (it may contain both)
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        A string containing the content of a certificate/key,
        <abbr title="Privacy-Enhanced Mail">PEM</abbr> encoded, may start with
        <code class="literal">-----BEGIN PUBLIC KEY-----</code>
       </span>
      </li>
      <li class="listitem">
       <span class="simpara">
        For private keys, you may also use the syntax
        <code class="literal">array($key, $passphrase)</code> where <var class="varname">$key</var> represents a
        key specified using the file:// or textual content notation above, and
        <var class="varname">$passphrase</var> represents a string containing the passphrase for that
        private key
       </span>
      </li>
     </ol>
    </p> 
   </li>
  </ul>
 </p>
</div>
<?php manual_footer($setup); ?>