(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_pkey_get_private — 获取私钥
$private_key, ?string $passphrase = null): OpenSSLAsymmetricKey|false
openssl_pkey_get_private() 解析
private_key 供其他函数使用。
private_key
private_key 可以是如下密钥之一:
passphrase
如果指定的密钥已被加密了(受密码保护),可选参数 passphrase 是必须要的。
成功时现在返回 OpenSSLAsymmetricKey 实例,失败时返回 false。
| 版本 | 说明 |
|---|---|
| 8.0.0 |
成功时,此函数现在返回 OpenSSLAsymmetricKey 实例;之前返回类型
OpenSSL key 的 资源(resource)。
|
| 8.0.0 |
private_key 现在接受 OpenSSLAsymmetricKey 或
OpenSSLCertificate 实例;之前接受类型
OpenSSL key 或 OpenSSL X.509 的 资源(resource)。
|
| 8.0.0 |
passphrase 现在可为 null。
|