= 4.2.0, PHP 5, PHP 7, PHP 8)openssl_pkey_export_to_file — 將密鑰導(dǎo)出到文件中 說明openssl_pkey_export_to_file( mixed $key, ">

openssl_pkey_export_to_file

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

openssl_pkey_export_to_file將密鑰導(dǎo)出到文件中

說明

openssl_pkey_export_to_file(
    mixed $key,
    string $outfilename,
    string $passphrase = ?,
    array $configargs = ?
): bool

openssl_pkey_export_to_file() 將 ascii 格式 (PEM編碼)的 key 保存到名為outfilename文件中。

注意: 必須安裝有效的 openssl.cnf 以保證此函數(shù)正確運(yùn)行。參考有關(guān)安裝的說明以獲得更多信息。

參數(shù)

key

outfilename

輸出文件的路徑。

passphrase

密鑰可以通過值為passphrase的密碼來保護(hù)。

configargs

configargs 可以用來調(diào)整導(dǎo)出流程,通過指定或者覆蓋openssl配置文件選項(xiàng)。參見 openssl_csr_new() 獲取更多關(guān)于 configargs 的信息。

返回值

成功時(shí)返回 true, 或者在失敗時(shí)返回 false。