openssl_pkcs12_export_to_file
(PHP 5 >= 5.2.2, PHP 7, PHP 8)
openssl_pkcs12_export_to_file — 输出一个 PKCS#12 兼容的证书存储文件
说明
openssl_pkcs12_export_to_file(
OpenSSLCertificate|string
string
#[\SensitiveParameter] OpenSSLAsymmetricKey|OpenSSLCertificate|array|string
#[\SensitiveParameter] string
array
): bool
OpenSSLCertificate|string
$certificate
,string
$output_filename
,#[\SensitiveParameter] OpenSSLAsymmetricKey|OpenSSLCertificate|array|string
$private_key
,#[\SensitiveParameter] string
$passphrase
,array
$options
= []): bool
openssl_pkcs12_export_to_file() 以 PKCS#12 文件格式将 certificate
保存至 output_filename
文件中。
参数
更新日志
版本 | 说明 |
---|---|
8.0.0 |
certificate 现在接受 OpenSSLCertificate
实例;之前接受类型 OpenSSL X.509 CSR 的 resource。
|
8.0.0 |
private_key 现在接受 OpenSSLAsymmetricKey
或 OpenSSLCertificate 实例;之前接受类型 OpenSSL key
或 OpenSSL X.509 的 resource。
|
+添加备注
用户贡献的备注 2 notes
greejd ¶
6 years ago
please note
the key 'friendlyname' should be 'friendly_name' in args
$args = array(
'friendly_name'=> 'www.example.com'
);
lampacz at gmail dot com ¶
15 years ago
[, array $args ] can contain only: extracerts, friendly_name
extracerts - additional certificates (can be file or string)
friendly_name - "friendly name" for the certificate and private key. This name is typically displayed in list boxes by software importing the file.
based on source code version 5.2.8 and pkcs12 man page
备份地址:http://www.lvesu.com/blog/php/function.openssl-pkcs12-export-to-file.php