<!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>Returns an array with the key details</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-free.html">openssl_pkey_free</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-get-private.html">openssl_pkey_get_private</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-details" class="refentry"> <div class="refnamediv"> <h1 class="refname">openssl_pkey_get_details</h1> <p class="verinfo">(PHP 5 >= 5.2.0)</p><p class="refpurpose"><span class="refname">openssl_pkey_get_details</span> — <span class="dc-title">Returns an array with the key details</span></p> </div> <div class="refsect1 description" id="refsect1-function.openssl-pkey-get-details-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>openssl_pkey_get_details</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$key</code></span> )</div> <p class="para rdfs-comment"> This function returns the key details (bits, key, type). </p> </div> <div class="refsect1 parameters" id="refsect1-function.openssl-pkey-get-details-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"> Resource holding the key. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkey-get-details-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns an array with the key details in success or <strong><code>FALSE</code></strong> in failure. Returned array has indexes <em>bits</em> (number of bits), <em>key</em> (string representation of the public key) and <em>type</em> (type of the key which is one of <strong><code>OPENSSL_KEYTYPE_RSA</code></strong>, <strong><code>OPENSSL_KEYTYPE_DSA</code></strong>, <strong><code>OPENSSL_KEYTYPE_DH</code></strong>, <strong><code>OPENSSL_KEYTYPE_EC</code></strong> or -1 meaning unknown). </p> <p class="para"> Depending on the key type used, additional details may be returned. Note that some elements may not always be available. </p> <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <strong><code>OPENSSL_KEYTYPE_RSA</code></strong>, an additional array key named <em>"rsa"</em>, containing the key data is returned. </span> <table class="doctable informaltable"> <thead> <tr> <th>Key</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td><em>"n"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"e"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"d"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"p"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"q"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"dmp1"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"dmq1"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"iqmp"</em></td> <td class="empty"> </td> </tr> </tbody> </table> </li> <li class="listitem"> <span class="simpara"> <strong><code>OPENSSL_KEYTYPE_DSA</code></strong>, an additional array key named <em>"dsa"</em>, containing the key data is returned. </span> <table class="doctable informaltable"> <thead> <tr> <th>Key</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td><em>"p"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"q"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"g"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"priv_key"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"pub_key"</em></td> <td class="empty"> </td> </tr> </tbody> </table> </li> <li class="listitem"> <span class="simpara"> <strong><code>OPENSSL_KEYTYPE_DH</code></strong>, an additional array key named <em>"dh"</em>, containing the key data is returned. </span> <table class="doctable informaltable"> <thead> <tr> <th>Key</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td><em>"p"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"g"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"priv_key"</em></td> <td class="empty"> </td> </tr> <tr> <td><em>"pub_key"</em></td> <td class="empty"> </td> </tr> </tbody> </table> </li> </ul> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.openssl-pkey-free.html">openssl_pkey_free</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.openssl-pkey-get-private.html">openssl_pkey_get_private</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>