<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Get a private key</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-get-details.html">openssl_pkey_get_details</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-get-public.html">openssl_pkey_get_public</a></div> <div class="up"><a href="ref.openssl.html">OpenSSL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.openssl-pkey-get-private" class="refentry"> <div class="refnamediv"> <h1 class="refname">openssl_pkey_get_private</h1> <p class="verinfo">(PHP 4 >= 4.2.0, PHP 5)</p><p class="refpurpose"><span class="refname">openssl_pkey_get_private</span> — <span class="dc-title">Get a private key</span></p> </div> <div class="refsect1 description" id="refsect1-function.openssl-pkey-get-private-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><strong>openssl_pkey_get_private</strong></span> ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$key</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$passphrase</code><span class="initializer"> = ""</span></span> ] )</div> <p class="para rdfs-comment"> <span class="function"><a href="function.openssl-get-privatekey.html" class="function">openssl_get_privatekey()</a></span> parses <em><code class="parameter">key</code></em> and prepares it for use by other functions. </p> </div> <div class="refsect1 parameters" id="refsect1-function.openssl-pkey-get-private-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">key</code></em></span> <dd> <p class="para"> <em><code class="parameter">key</code></em> can be one of the following: <ol type="1"> <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 PEM encoded certificate/private key (it may contain both). </span> </li> <li class="listitem"><span class="simpara">A PEM formatted private key.</span></li> </ol> </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">passphrase</code></em></span> <dd> <p class="para"> The optional parameter <em><code class="parameter">passphrase</code></em> must be used if the specified key is encrypted (protected by a passphrase). </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkey-get-private-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a positive key resource identifier on success, or <strong><code>FALSE</code></strong> on error. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-get-details.html">openssl_pkey_get_details</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-get-public.html">openssl_pkey_get_public</a></div> <div class="up"><a href="ref.openssl.html">OpenSSL Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>