openssl_pkey_export_to_file
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_pkey_export_to_file — 將金鑰導出到檔案中
說明
openssl_pkey_export_to_file(
mixed
string
string
array
): bool
mixed
$key,string
$outfilename,string
$passphrase = ?,array
$configargs = ?): bool
openssl_pkey_export_to_file() 將 ascii 格式
(PEM編碼)的 key 儲存到名為outfilename檔案中。
注意: 必須安裝有效的 openssl.cnf 以保證此函式正確執行。參考有關安裝的說明以獲得更多資訊。
參數
-
key -
-
outfilename -
輸出檔案的路徑。
-
passphrase -
金鑰可以通過值為
passphrase的密碼來保護。 -
configargs -
configargs可以用來調整導出流程,通過指定或者覆蓋openssl配置檔案選項。參見 openssl_csr_new() 獲取更多關於configargs的資訊。
返回值
成功時返回 true, 或者在失敗時返回 false。