<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.openssl-x509-check-private-key.php',
    1 => 'openssl_x509_check_private_key',
    2 => '秘密鍵が証明書に対応するかを確認する',
  ),
  'up' => 
  array (
    0 => 'ref.openssl.php',
    1 => 'OpenSSL 関数',
  ),
  'prev' => 
  array (
    0 => 'function.openssl-verify.php',
    1 => 'openssl_verify',
  ),
  'next' => 
  array (
    0 => 'function.openssl-x509-checkpurpose.php',
    1 => 'openssl_x509_checkpurpose',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/openssl/functions/openssl-x509-check-private-key.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.openssl-x509-check-private-key" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">openssl_x509_check_private_key</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">openssl_x509_check_private_key</span> &mdash; <span class="dc-title">秘密鍵が証明書に対応するかを確認する</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.openssl-x509-check-private-key-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>openssl_x509_check_private_key</strong></span>(<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>, <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>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <code class="parameter">private_key</code> が <code class="parameter">certificate</code>
   に対応する秘密鍵かどうかを調べます。
  </p>
  <div class="warning"><strong class="warning">警告</strong>
    <p class="para">
     この関数は <code class="parameter">private_key</code> が秘密鍵かどうかをチェックしません。
     単に、公開されている材料 (例: RSA 鍵の exponent や modulus)
     かつ/または キーペアのキーのパラメータ (例: ECキー の EC params) を比較しているだけです。
    </p>
    <p class="para">
     これはたとえば、公開鍵を <code class="parameter">private_key</code> に与えても、
     関数が <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を返す可能性があるということです。
    </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.openssl-x509-check-private-key-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">certificate</code></dt>
     <dd>
      <p class="para">
       証明書。
      </p>
     </dd>
    
    
     <dt><code class="parameter">private_key</code></dt>
     <dd>
      <p class="para">
       秘密鍵。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.openssl-x509-check-private-key-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   <code class="parameter">private_key</code> が
   <code class="parameter">certificate</code> に対応する秘密鍵の場合に
   <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>、それ以外の場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.openssl-x509-check-private-key-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">certificate</code> は、
       <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> クラスのインスタンスを受け入れるようになりました。
       これより前のバージョンでは、
       <code class="literal">OpenSSL X.509</code> 型のリソースを受け入れていました。
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">private_key</code> は、
       <span class="classname"><a href="class.opensslasymmetrickey.php" class="classname">OpenSSLAsymmetricKey</a></span> または
       <span class="classname"><a href="class.opensslcertificate.php" class="classname">OpenSSLCertificate</a></span> クラスのインスタンスを受け入れるようになりました。
       これより前のバージョンでは、
       <code class="literal">OpenSSL key</code> または
       <code class="literal">OpenSSL X.509</code> 型のリソースを受け入れていました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


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