array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.openssl-pkey-get-private.php', 1 => 'openssl_pkey_get_private', ), 'up' => array ( 0 => 'ref.openssl.php', 1 => 'OpenSSL 関数', ), 'prev' => array ( 0 => 'function.openssl-pkey-get-details.php', 1 => 'openssl_pkey_get_details', ), 'next' => array ( 0 => 'function.openssl-pkey-get-public.php', 1 => 'openssl_pkey_get_public', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/openssl/functions/openssl-pkey-get-private.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_pkey_get_private — 秘密鍵を取得する
$private_key
, ?string $passphrase
= null
): OpenSSLAsymmetricKey|false
openssl_pkey_get_private() は
private_key
をパースし、他の関数で使用できるよう準備します。
private_key
private_key
は以下のいずれかです。
passphrase
指定されたキーが(パスフレーズを用いて)暗号化されている場合は、
オプションのパラメータ passphrase
を使用する必要があります。
成功した場合に、
OpenSSLAsymmetricKey クラスのインスタンスを返します。
エラー時に false
を返します。
バージョン | 説明 |
---|---|
8.0.0 |
成功した場合に、
この関数は OpenSSLAsymmetricKey クラスのインスタンスを返すようになりました。
これより前のバージョンでは、
OpenSSL key 型のリソースを返していました。
|
8.0.0 |
private_key は、
OpenSSLAsymmetricKey または
OpenSSLCertificate クラスのインスタンスを受け入れるようになりました。
これより前のバージョンでは、
OpenSSL key または
OpenSSL X.509 型のリソースを受け入れていました。
|
8.0.0 |
passphrase は、nullable になりました。
|