显示下拉菜单

openssl_pkey_export()

« openssl_get_publickey | openssl_pkey_get_details »
<?php
$key 
openssl_pkey_new(
    
 // [array $n_configargs]
);

$bool openssl_pkey_export (
    
// mixed $key
    
// string &$out
    
// [string $passphrase]
    
  // [array $configargs]
);
?>
结果
$out = '-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC6qqPwgKjDJNVj
O7YT8KsIWgfnPFTs1g9sf/UtWScTchf+90psJRqbFWlxq+nR4OJjdGODLAhkXv9w
f9OYwuaCOOqsnTUeSOC86cIlmtLCbuZienmQScJ6DF2qSPsQPdaeYsxqMTWbQ9ZQ
DOgvTRkqjH+1WP+3P7Ui4ZRo1+SjRohLO6LZTnTSZpswYpGi0FHHFf5W26/xiiQ9
IP42HXyosre6CpbGJKBc97arFkf3i78mcjIqNwsUs0peSd48Y1/nWjjUpUUd5UbK
Z+vgkVrJEmpdRryW4+jDNodXlUFGfPplHiHEETl/kPQ4oooM9lDpB5qCy+wp6YfL
dH3AknLQOZpCejtlN/r9zm9hxg/p4AAsNbCej51qZYV/hygJ4SzIVTNiikIZJSas
DLv4CM3x6B43YvMr2Vz/k/4O0KZDYLsmCKMbnZp430zid6MTy3Ue/SeyO3xV61/U
YHYZm/hbnbgZGnF5vRuJLQQuVbi1E+mG9E3n/hXRWPbcAbJeT00atey+BsJM4ZML
x2PMLj56xny7iQHRe4Om8IEXm1DPY9PApVxmzi7s7GTVbLAworPW8GZDGxfc1XJ8
Pu/5//MEtv+9F9xxtDibTrr5iV1rARjgJOPskVGMK7EpV4mLAJElC9l5GkYBnA/e
hoaCw2jl4jLcY5/K2q+v5e5seY9DkwIDAQABAoICAHt19WxSjExVhlVV3v2dRmIF
ugh03O6wPg9TKoRN3Qx9f+WBBdY1TD2akd0/CS1pghKpnk/ZxcstEeIEiZ0V+4PR
xVVZvRJEvW/1ZBWfKxqyYuprew+12U0D9Md18agyXkrvqafq2DvTSGI1xzPR2H1N
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rt15O698Lbe1+eSOopqPcF+FzGY0mJOKrDcZwdLooRo5Rzd9Ztf9A
O/+zUpnEppppqaUiLCalu+uHxCNT6J/MOW5iOvPKmdyceHdvOSznF7MKnF74iQWi
vOB44crvftUN2M5nCbdnnmEHtLjFgA==
-----END PRIVATE KEY-----
'
$bool = true
示例
#1 openssl_pkey_export  ($key,
 
$out,
 
"this is a passphrase")
#2 openssl_pkey_export  (/* $n_configargs = ["digest_alg" => "sha512", "private_key_bits" => 4096, "private_key_type" => OPENSSL_KEYTYPE_RSA] */
 
$key,
 
$out)
另请参阅
openssl_pkey_new