PHP8 openssl_pkcs12_export_to_file

2024-03-12 12:00 更新

(PHP 5 >= 5.2.2, PHP 7, PHP 8)

openssl_pkcs12_export_to_file — 輸出一個 PKCS#12 兼容的證書存儲文件

說明

openssl_pkcs12_export_to_file(
    OpenSSLCertificate|string $certificate,
    string $output_filename,
    OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key,
    string $passphrase,
    array $options = []
): bool

openssl_pkcs12_export_to_file() 以 PKCS#12 文件格式將 certificate 保存至 output_filename 文件中。

參數(shù) 

x509

參見密鑰/證書參數(shù)以獲取有效值列表。

output_filename

輸出文件的路徑。

private_key

PKCS#12 文件的私鑰部分。 參見 公/私鑰參數(shù) 獲取可用值的列表。

passphrase

用于解鎖 PKCS#12 文件的加密密碼。

options

可選數(shù)組,其他主鍵將被忽略。

Key說明
"extracerts"PKCS#12 文件中包含的額外證書或單個證書的數(shù)組。
"friendly_name"被證書和密鑰使用的字符串

返回值 

成功時返回 true, 或者在失敗時返回 false。

更新日志 

版本說明
8.0.0certificate 現(xiàn)在接受 OpenSSLCertificate 實例;之前接受類型 OpenSSL X.509 CSR 的 resource。
8.0.0private_key 現(xiàn)在接受 OpenSSLAsymmetricKey 或 OpenSSLCertificate 實例;之前接受類型 OpenSSL key 或 OpenSSL X.509 的 resource。


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號