<?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 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.openssl-pkey-get-details.php',
    1 => 'openssl_pkey_get_details',
    2 => 'Получает массив с детальной информацией о ключе',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'Функции OpenSSL',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-pkey-free.php',
    1 => 'openssl_pkey_free',
  ),
  'next' => 
  array (
    0 => 'function.openssl-pkey-get-private.php',
    1 => 'openssl_pkey_get_private',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/openssl/functions/openssl-pkey-get-details.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<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 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_pkey_get_details</span> &mdash; <span class="dc-title">Получает массив с детальной информацией о ключе</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.openssl-pkey-get-details-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_pkey_get_details</strong></span>(<span class="methodparam"><span class="type"><a href="class.opensslasymmetrickey.php" class="type OpenSSLAsymmetricKey">OpenSSLAsymmetricKey</a></span> <code class="parameter">$key</code></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Эта функция возвращает массив с детальной информацией о ключе.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-pkey-get-details-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">key</code></dt>
     <dd>
      <p class="para">
       Ресурс, содержащий ключ.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-pkey-get-details-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Возвращает массив с детальной информацией о ключе, либо <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
   Массив содержит следующие индексы: <code class="literal">bits</code> (количество бит),
   <code class="literal">key</code> (строковое представление открытого ключа) и
   <code class="literal">type</code> (тип ключа, одна из констант:
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-rsa">OPENSSL_KEYTYPE_RSA</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-dsa">OPENSSL_KEYTYPE_DSA</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-dh">OPENSSL_KEYTYPE_DH</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-ec">OPENSSL_KEYTYPE_EC</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-x25519">OPENSSL_KEYTYPE_X25519</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-ed25519">OPENSSL_KEYTYPE_ED25519</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-x448">OPENSSL_KEYTYPE_X448</a></code></strong>,
   <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-ed448">OPENSSL_KEYTYPE_ED448</a></code></strong>
   или <code class="literal">-1</code>, если неизвестно).
  </p>
  <p class="para">
   В зависимости от типа используемого ключа, могут быть возвращены дополнительные
   данные. Обратите внимание, что некоторых элементов может и не быть.
  </p>
  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     Для <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-rsa">OPENSSL_KEYTYPE_RSA</a></code></strong> возвращается элемент с индексом
     <code class="literal">&quot;rsa&quot;</code>, содержащий данные ключа.
    </span>
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>Ключ</th>
        <th>Описание</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td><code class="literal">&quot;n&quot;</code></td>
        <td>модуль</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;e&quot;</code></td>
        <td>открытая экспонента</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;d&quot;</code></td>
        <td>секретная экспонента</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;p&quot;</code></td>
        <td>первое простое число</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;q&quot;</code></td>
        <td>второе простое число</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;dmp1&quot;</code></td>
        <td>первая экспонента, d mod (p-1)</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;dmq1&quot;</code></td>
        <td>вторая экспонента, d mod (q-1)</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;iqmp&quot;</code></td>
        <td>коэффициент, (1 / q) mod p</td>
       </tr>

      </tbody>
     
    </table>

   </li>
   <li class="listitem">
    <span class="simpara">
     Для <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-dsa">OPENSSL_KEYTYPE_DSA</a></code></strong> возвращается элемент с индексом <code class="literal">&quot;dsa&quot;</code>, содержащий данные ключа.
    </span>
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>Ключ</th>
        <th>Описание</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td><code class="literal">&quot;p&quot;</code></td>
        <td>Простое число (публичное)</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;q&quot;</code></td>
        <td>160-битное простое число, такое, что p-1 делится на q (публичное)</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;g&quot;</code></td>
        <td>Генератор подгрупп (публичный). Мультипликативный порядок g по модулю p равен q</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;priv_key&quot;</code></td>
        <td>Секретный ключ x</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;pub_key&quot;</code></td>
        <td>Открытый ключ y = g^x</td>
       </tr>

      </tbody>
     
    </table>

   </li>
   <li class="listitem">
    <span class="simpara">
     Для <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-dh">OPENSSL_KEYTYPE_DH</a></code></strong> возвращается элемент с индексом <code class="literal">&quot;dh&quot;</code>, содержащий данные ключа.
    </span>
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>Ключ</th>
        <th>Описание</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td><code class="literal">&quot;p&quot;</code></td>
        <td>Простое число (открытое)</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;g&quot;</code></td>
        <td>Генератор Z_p (открытый), простое число, первообразный корень по модулю p</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;priv_key&quot;</code></td>
        <td>секретное DH значение x</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;pub_key&quot;</code></td>
        <td>открытое DH значение g^x</td>
       </tr>

      </tbody>
     
    </table>

   </li>
   <li class="listitem">
    <span class="simpara">
     <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-x25519">OPENSSL_KEYTYPE_X25519</a></code></strong>,
     <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-ed25519">OPENSSL_KEYTYPE_ED25519</a></code></strong>,
     <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-x448">OPENSSL_KEYTYPE_X448</a></code></strong>,
     или <strong><code><a href="openssl.key-types.php#constant.openssl-keytype-ed448">OPENSSL_KEYTYPE_ED448</a></code></strong>
     дополнительный ключ массива с именем
     <code class="literal">&quot;x25519&quot;</code>,
     <code class="literal">&quot;ed25519&quot;</code>,
     <code class="literal">&quot;x448&quot;</code>
     или <code class="literal">&quot;ed448&quot;</code> соответственно,
     возвращается, содержащий данные ключа.
    </span>
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>Ключ</th>
        <th>Описание</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td><code class="literal">&quot;priv_key&quot;</code></td>
        <td>закрытый ключ</td>
       </tr>

       <tr>
        <td><code class="literal">&quot;pub_key&quot;</code></td>
        <td>открытый ключ</td>
       </tr>

      </tbody>
     
    </table>

   </li>
  </ul>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openssl-pkey-get-details-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       Добавлена поддержка ключей на основе Curve25519 и Curve448.
       В частности, были добавлены поля <code class="literal">x25519</code>,
       <code class="literal">ed25519</code>,<code class="literal">x448</code> и <code class="literal">ed448</code>.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">key</code> теперь принимает экземпляр <span class="classname"><a href="class.opensslasymmetrickey.php" class="classname">OpenSSLAsymmetricKey</a></span>;
       ранее принимался ресурс (<span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>) типа <code class="literal">OpenSSL key</code>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


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