please note
the key 'friendlyname' should be 'friendly_name' in args
$args = array(
'friendly_name'=> 'www.example.com'
);
PHP - Manual: openssl_pkcs12_export_to_file
2024-11-12
(PHP 5 >= 5.2.2, PHP 7, PHP 8)
openssl_pkcs12_export_to_file — 输出一个 PKCS#12 兼容的证书存储文件
$x509
,$filename
,$priv_key
,$pass
,$args
= ?
openssl_pkcs12_export_to_file() 函数以 PKCS#12 格式将 x509
保存至文件名为 filename
的文件中。
成功时返回 true
, 或者在失败时返回 false
。
please note
the key 'friendlyname' should be 'friendly_name' in args
$args = array(
'friendly_name'=> 'www.example.com'
);
[, 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
官方地址:https://www.php.net/manual/en/function.openssl-pkcs12-export-to-file.php