= 4.2.0, PHP 5, PHP 7, PHP 8)openssl_pkey_get_private — 獲取私鑰說(shuō)明openssl_pkey_get_private(mixed $key, string $passphrase ">

openssl_pkey_get_private

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

openssl_pkey_get_private獲取私鑰

說(shuō)明

openssl_pkey_get_private(mixed $key, string $passphrase = ""): resource

openssl_get_privatekey() 解析 key 供其他函數(shù)使用。

參數(shù)

key

key 可以是如下密鑰之一:

  1. 如下格式的字符串 file://path/to/file.pem。該文件必須包含 PEM 編碼的證書或者私鑰 (可能都包含了).
  2. 一個(gè)PEM格式的私鑰。

passphrase

如果指定的密鑰已被加密了(受密碼保護(hù)),可選參數(shù) passphrase 是必須要的。

返回值

成功,返回真實(shí)的密鑰資源標(biāo)識(shí)符,失敗,返回 false .