(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_pkey_export_to_file — 將金鑰的可匯出表示形式寫入檔案
$key
,$output_filename
,$passphrase
= null
,$options
= null
openssl_pkey_export_to_file() 將 ASCII 裝甲(PEM 編碼)格式的 key
儲存至名為 output_filename
的檔案中。
注意: 您需要安裝有效的 openssl.cnf 檔案才能使此函式正常運作。詳情請參閱安裝章節下的注意事項。
key
output_filename
輸出檔案的路徑。
passphrase
金鑰可以選擇性地使用 passphrase
保護。
options
options
可用於透過指定和/或覆寫 openssl 設定檔中的選項來微調匯出過程。有關 options
的詳細資訊,請參閱 openssl_csr_new()。
版本 | 說明 |
---|---|
8.0.0 |
key 現在接受 OpenSSLAsymmetricKey 或 OpenSSLCertificate 實例;先前接受類型為 OpenSSL key 或 OpenSSL X.509 的資源。 |