PHP openssl_pkey_export_to_file OpenSSL 函数

  • 定义和用法

    openssl_pkey_export_to_file - 将密钥导出到文件中
  • 版本支持

    PHP4 PHP5 PHP7
    支持 支持 支持
  • 语法

    openssl_pkey_export_to_file( mixed $key , string $outfilename [, string $passphrase [, array $configargs ]] )
    openssl_pkey_export_to_file() ascii 格式 (PEM编码)的 key 保存到名为outfilename文件中。
    注意: 必须安装有效的 openssl.cnf 以保证此函数正确运行。
  • 参数

    参数 必需的 描述
    key 秘钥
    outfilename 输出文件名称
    passphrase 密钥可以通过值为passphrase的密码来保护。
    configargs configargs 可以用来调整导出流程,通过指定或者覆盖openssl配置文件选项。参见 openssl_csr_new() 获取更多关于 configargs 的信息。
  • 返回值

    成功时返回 TRUE, 或者在失败时返回 FALSE。
  • 相关页面

    openssl_get_md_methods() - 获取可用的摘要算法