« openssl_pkey_export_to_file
openssl_pkey_get_details »

openssl_pkey_free

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

openssl_pkey_free — 秘密鍵を解放する

警告

この関数は PHP 8.0.0 で 非推奨になります。この関数に頼らないことを強く推奨します。

説明

#[\Deprecated(
    since: '8.0',
    message: 'as OpenSSLAsymmetricKey objects are freed automatically',
)]

function openssl_pkey_free(OpenSSLAsymmetricKey $key): void

注意:

この関数を実行しても何も起こりません。PHP 8.0.0 より前のバージョンでは、この関数はリソースを閉じるのに使われていました。

この関数は、openssl_pkey_new() で作成した秘密鍵を解放します。

パラメータ

key

キーを保持するリソース。

戻り値

値を返しません。

変更履歴

バージョン 説明
8.0.0 この関数は推奨されなくなりました。 なぜなら、実行しても何の効果もなくなったからです。
8.0.0 key は、 OpenSSLAsymmetricKey クラスのインスタンスを受け入れるようになりました。 これより前のバージョンでは、 OpenSSL key 型のリソースを受け入れていました。
関連キーワード:
openssl   pkey   秘密   解放   free   OpenSSLAsymmetricKey   リソース   OpenSSL   推奨   export   details   非推奨   Deprecated   since   message   objects   freed   automatically   キー   保持   履歴   効果   インスタンス
関連する関数・ページ:
function.openssl-pkey-get-private   function.openssl-free-key   function.openssl-pkey-export-to-file   function.openssl-get-publickey   function.openssl-pkey-export   function.openssl-csr-get-public-key