Display the drop-down list

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]
);
?>
Result
$out = '-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIXDr1zsdE1lgCAggA
MBQGCCqGSIb3DQMHBAi1JTdbWlDj3gSCBMgkwwGqtnGurqWeiqJD5qEHbzpTTXAN
zW+FwjuRkrxa1EkA71bSwa7vGHnBY+5qZGLk2Ijx7ArkOJcKCKrbXTAzaBI/T613
uzfdCBOaIk8mni1PikhNnMgzO9nWDIJb5HRM7Qmkx77Ze3pTcKwMsV0WVlefG9Ld
7fmnmaE1WZomnIfX7RiPsFSj4/dRI9M2SsSX3xIWWwVCmGQ/38PTslhkQ+uo0Id9
klNa3SS28JJPHZ0kloUsZFvgxIMLOmcir34K9pisYXhR21BTlkHqnbfI9cwtiWAa
YIaRP66jcOCBZ+pBr2dNz/VUMcDdyTwSkKY+TBn+SbY9NTmDvPBGWk7zgIDiMhGA
HzpCoUWMeOQik/aDPDS7vO0ACiJOgxfeI85GLx365YSJ3MN5PA3Zag2Of390yo5U
DDjGxgvJ1gqRcJCxWD32ztZ4YmxzuucBncTakGasE8CuvIOjIfkCFN/Z5poKWcr7
Qurik2CM41kNeGVyy5rEyni4kDyG2gVMWKvqSytaL4NmIIwTuSVocEbTT7A/fnkL
85h/iL9HvA0O02v+3hKY1RJ+wqCFf3E0pSLaVeB73UjlwwT2MHN0ds+1Sj7L65Zp
90jxrEdxyl30qWbUa4+L2gAUOJO5kOuYv3Dh2hlhUhVWpZP0fCT7JNRXu6xp/1NV
ZTQoc9DTSrTn4onjGtTuTm84bC43jkValO+bVpFrVOH9dXW2oMHJHJ6J7LooY4W8
55bfzKki4kQbyWez5f1knGBG89aL3Zc+uBTD7d6BcEg0S5oED87u6h2/1W6dKi1X
73z3j/VPwcJk5SR8fHTqJV3TL+GVLcyZ4Az6vV6zERPApCeGwioYqkYadJm7lEqg
EFHXgtgeaNX7rkcnMPfAMLg8tem2OXnqpHNGpIwQWxEBmkIIB9W6sX5AWDQm6Gut
b0Be+3rogWe3MiuygJVHI+KivMESeJomZO82XlPbmjo6TYarR5LHCyuH5zxsxXZY
fxvI5G3S207xw1r0ZBrdLUG8ylwa3MNHl/rrZK/FDh5RXRyEpA+RQ0bp9OW7sT3T
Z3vgP8r9I+fObP7UdaxiSFH1z7gDfkxiNYXAwdoEPGfcEFhsPhJ1Xg+uvsc4ff2L
m+Xl5NcREocQjHZwTLGSnQ14rtgKzmc+ak2guhJs0dXGAw/lcbH2KRcCdd1m2hJV
/tTl75yuE1tJ8tLNBWCuQOhy8FXKaJiCDO2lDY3j4EJGxb6XOONvZaph20qA2LMw
77lPtiLR/StHWDJ2Jv1AZUr4Ga1LvjTS7wLlK9VxBvITldBLPugdQxKUMre+0VMP
XKA22RzfA6ZHRosPn+mqAUV3aiFY2zm0KU8669Rr5iMWDOXcSqiIjBO4c2RVVdRu
RbHBZCRjcMUGpoARQef7AE+UzFnQFh3iXZ2vOqdm2QBhBnO4HtjUeHMfoPh/CsSi
DSN2riAG96fx1H8Dl99exQRaSfoW3L9jvXWjPIzInPB0S0xcTXGMUvJcg4FuqfzG
cW45ZW8ofi1r2vzLBhbt5OPSLb1+kxjC1XZsFECtDGolhJUgpQaCf3w1RF9eh3yX
NjoG+3zWk7UlwBH6kUPtPNUcroznOpjU7If/lY4GcaPUQut6ezL/cflz7eMIexiq
/p8=
-----END ENCRYPTED PRIVATE KEY-----
'
$bool = true
Examples
#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)
See also
openssl_pkey_new