显示下拉菜单

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIufcVQFga7iQCAggA
MBQGCCqGSIb3DQMHBAiA8ADN9wvRUwSCBMiNEA3EywdwhwSkCzlz9Z+OKUdYfrpR
kB2CQ4DTsppi1aHNzYb4y3Q59kwd3XQsLASk9/b5TBY7SyQcLQKNvDWsV9oNIwME
EImVZXh2+40W/hk0hwFytmS8SZu5sGQ2nzay/B9v88EGPTQhRwumuakqyTjM5C8j
r6VoMPPXEqNSG0x4kjRn8l//LO0IAoVxWhSpRZhFZBdAFy8gq8gsZzr4HxGnNOCY
rvCk5VWGaq48F2e+tPhq2QHAYBKfOmmdAI1wX6VeXQNMf28n0Rr25+gffHBFub9g
+5AHRiZye+S6Yds3+JmYCzTSjOiiQXXlltDF+jr3DiwHeNO0ZrulsDRgyi7Pl0HJ
UVgxToLH1o/e5MjTPj8FVfY5APcVWi/LB0ith3tGViatf4UTjrYjjpXOhlyIzFiY
7PPgEM/yL3IrrvFXXp0iDPlF70zNtsPJ9ubN9j+yFIAn1mGAO6yYwO9PDaRvjXtU
mzbSpFITQBwI60/7z9sAyYhn9j/X/r+mN2GTV15UvriUCeZVPhysaIMiy4JqDbYS
hgcgZPa4DulYB/YPu4RZjYgjCiwSwjB48AZepFygfd14JQ5qhY7qU9V8O1HeWMIZ
/2m3QfoxhYfRhBrNIWUqNYU2+0YOuUO6Wg3HqoRzT8T5Z9ZOp29aUXVOwee8itJk
D2okgzz6aZw/A+ldv4UQsqh3J+8i91Y2u+JwhjoalTx1m7Y/PclP7hXsiAx1WSWd
5rUTNeyDr0pWLTFy01MIPcTFltAsh8l9FQ1DjeBXSRckbXODcD74VZaJSwLavF4x
WEEwUyu7NBDZKiHfNhIoXYZDsZCGyaSnnTqmRb43WSzKEhYmK5Pu//ijDY6YOVls
lQ7SvV7Kdpw/hLHJHBL02w1aDn65zzHa/W9sM2eFUAUoM1HQ6YGtLEo544S7RuK9
7qEG5PH4C00XK2w+QEXp3M9iuoBCrqd94TQPnZfb+P9M/aT+ujCvBaFwFulZvrhO
blwlOPjWtMJduIzW6Q6BAx2jG2MHr6lORQ3ZB3WvOMlnI64elRi9N4fxmGWykTBi
AXVykSdq5ZMW+NwpCrrpzKt6DaSGzNLHdUE4sRC/bhclj4PaIOPFpU/NnnR+pT6Q
D7tMVJifI9UC9OtsRjDAFHJ1y9Gc7+KCm31jCBMfZUDiaFji1d40C/trMq12q2fg
53ZQAGZaXul0JcSb7ba8ljksJCDJ0l5C4OSoiI1qA/GvnAEa0M6qHCCDYkKIyzo8
3ORxgOFQx7NkEoPUxTJlH11kg9lTJ6mALWOnN85Td9ASR4fcu0lTRdxqcnM/ty5d
LXSArZiydAohSRIceVvm1Bn3EdcyOyuoPO+dZ+lxiRqnpQTPKagVlpwybuTbAmvB
bXG0YGfFAnDxHXbpOHXV0fcy9w3c92UVpkwbTc8S4eY5qI22/c9D7l4GBg6yaFJq
R4UF2zg5C+y4Btiy6cwc2zwiVRLThyHDUh59QiK/gR6n/lUFYdloiojmSD0UVsek
y+wVNS4+0ukJcp4iy9zxdOVqusHAer796gnbdexHF+y5Tr031zAwe1kbFSqd4akU
qF7UxGSFZR0xz4oLRoqncSjIs+fxF1u6MC6gX/b8QaX3i7EOZHmpPP4a505QaIdS
opQ=
-----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