array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.openssl-pkey-get-public.php', 1 => 'openssl_pkey_get_public', ), 'up' => array ( 0 => 'ref.openssl.php', 1 => 'OpenSSL 函数', ), 'prev' => array ( 0 => 'function.openssl-pkey-get-private.php', 1 => 'openssl_pkey_get_private', ), 'next' => array ( 0 => 'function.openssl-pkey-new.php', 1 => 'openssl_pkey_new', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/openssl/functions/openssl-pkey-get-public.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
openssl_pkey_get_public — 从证书中解析公钥,以供使用
$public_key
): OpenSSLAsymmetricKey|false
openssl_pkey_get_public() 从 public_key
中解析公钥,供其他函数使用。
public_key
public_key
可以是以下之一:
成功时返回 OpenSSLAsymmetricKey 实例,错误时返回 false
。
版本 | 说明 |
---|---|
8.0.0 |
成功时,此函数现在返回 OpenSSLAsymmetricKey 实例;之前返回类型
OpenSSL key 的 resource。
|
8.0.0 |
public_key 现在接受 OpenSSLAsymmetricKey
或 OpenSSLCertificate 实例;之前接受类型
OpenSSL key 或 OpenSSL X.509 的 resource。
|