显示下拉菜单

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 ENCRYPTED PRIVATE KEY-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIB1qhtFcqXEYCAggA
MBQGCCqGSIb3DQMHBAjfOK1DfJpocgSCBMiV6mg2IoeiYpCU1euoK88Fj8X2XSOm
E1mJaV5IThN5DydIqVNH9JX0YNdBJqMTEZDLdjfQ61+14VeRc2KrPpFVzlP30DMb
khPejVIfQFNhtV37oumt/ODE6ojEYhY1qXarOzDicaV9j8m9UNJynewrixByPCOd
EgFdcbqmM+XQhenc0WiXzzd3pSaUnyWSrhew3T6q18G5JN6TuxtLmQaI8N4stCsj
HASReiy/j9I6S+06eBnjnL6IcchKHEhGI1BcPrdicc7i5hOt+K7FjD2v6ETJURGx
8r4r2HCVHnu42vc4cVjN9rVYtJ3AsN/vclhCqW5dHFkHuuKGQ290g9rgXak4TNs5
7giBfo3Yz9XJtnv2Thg40XZYsiKYqkuB4kzyrEQbac9gFxSFtsCh0E7MaSRzdZCJ
slflKJtmuXM9OIlhEalAqFTjGKcy2XUefEbRnHEOU9dQXXp10T2j4K0ySZcRhjUt
srinZAsMfaw49IqtnA+QFYKQEPUqEwNvFbOlOnALgNl9EEXOSpUqz06G+n5GRj7y
nshFS+tcPNX1+d7/tEcnlbJzLNItJGhTiGjT+7eei4E9E+y41eRurH8e1e6PTDXS
WrEXDJ8lkD9cCS0xp+gFAAMjxB5ofiDBHMuyVLWuHzQEnMC0mt1rLXqGHBeVDRpR
lfHH5DHDxcIWBpBqVz8ognUMXr7ByKLT7En7Qi9GLOEOuYlc44+eYz3OOP2wOMTS
x6nrq2yg7RgurMixHz97/NXGuN/5QojTh4WDe1cVf4Y1wiNKaDgtmGroie+PXo1F
e2ir5+Lf7hmLnkt1uP+HqcxauEQ+Dahc9DeEUErf4uwfqosNZbGjXHRvgMCDnj/0
lPju02JnNmhQKnhov2Qx7woAXN15NPgakXAHWffZVkTIA02gi3HHZq5QKpwvjHZn
wfepth2l67s8DoA4/qJK7kC0oVYA0c6y6u7BKEKDLZJpT2mj+ezhlV3Ei0Ve1TMx
+tMV+AVdaFUw7rA+D+PKvrwqxw1DXcUnBZy/qtnd3IuWszSfBpD2RQ65pEzQmbKO
XuYc6LHej94dCRxycvl97wKz+/sZLnuq+IvsTA6iu9HlEtGS1wv2oLbh/c/lmiiA
Ha6NR7/F6qJfENnxXUaNW382Oq1lKltN9JhzyWQauz0AZ9dsNHqCKwf9IMRdonrI
U/JAu7pZdTSrkVr+nhaCOVOBCHmM0xie2z6BLTh7eexfc4/+vLnkCzk3I+/d4s+B
zXrPtFBU+A94Tu1Uw/hAYIaSZ+Fv913VHHvniZYydOz4GtUpHaXyg5vCkVNgGQqJ
bm6kQ5qXiJmeA2I6guhr8AQPA6qqCTHhZdaJe4NjDg8RzawHMz+Hon5+1ivAi6C4
QsLO2bWX4hLEjjDGptmpQdJ7bLhuPuHAVp7SjRVqP2YWdJVH0khnMG7GIGWpoV7s
x+ulBYGWB9+rnVaZckHTDe2zIVi7lTYv4WlrnrdmLK2rp1wmMiFHLF4pokDR7UMi
bNoAHHpNhmIZOJPsH8drIyTEe/WM/2h73W20BDjqexxOC+KXtILvQF2t6/rzmRpB
hIMDhx8FL5CdFN43bn/1Ug3UuhWEhEg9PV16gd/98R33Q7yUE02eyS2imPcH/Ky/
sss=
-----END ENCRYPTED 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