openssl_pkey_export

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

openssl_pkey_export将一个密钥的可输出表示转换为字符串

说明

openssl_pkey_export(
    OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $key,
    string &$output,
    ?string $passphrase = null,
    ?array $options = null
): bool

openssl_pkey_export()key 当作 PEM 编码字符串导出并且将之保存到output (通过引用传递的)中。

注意: 必须安装有效的 openssl.cnf 以保证此函数正确运行。参考有关安装的说明以获得更多信息。

参数

key

output

passphrase

密钥可以通过 passphrase 来保护。

options

options 可以用来调整导出流程,通过指定或者覆盖openssl配置文件选项。参见 openssl_csr_new() 获取更多关于 options 的信息。

返回值

成功时返回 true, 或者在失败时返回 false

更新日志

版本 说明
8.0.0 key 现在接受 OpenSSLAsymmetricKeyOpenSSLCertificate 实例;之前接受类型 OpenSSL keyOpenSSL X.509资源(resource)
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top