• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • openssl_pkcs12_export_to_file()

    (PHP 5 >= 5.2.2, PHP 7)

    输出一个 PKCS#12 兼容的证书存储文件

    说明

    openssl_pkcs12_export_to_file(mixed $x509,string $filename, mixed $priv_key,string $pass[,array $args]): bool

    openssl_pkcs12_export_to_file()函数以 PKCS#12 格式将$x509保存至文件名为$filename的文件中。

    参数

    $x509

    参见密钥/证书参数以获取有效值列表。

    $filename

    输出文件的路径。

    $priv_key

    PKCS#12文件的私钥部分。参见公/私钥参数获取可用值的列表。

    $pass

    用于解锁 PKCS#12 文件的加密密码。

    $args

    可选数组,其他主键将被忽略。

    Key说明
    "extracerts"PKCS#12 文件中包含的额外证书或单个证书的数组。
    "friendlyname"被证书和密钥使用的字符串

    返回值

    成功时返回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