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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIdHlamo0WVJkCAggA
MBQGCCqGSIb3DQMHBAjUJbuHoi7SsQSCBMigBE4D6PyrNvUAPgeVO4Rvwagx2+X0
lkF9xKZrLReZ71ppxr8O8JhFDHAilRjGuCh70Nj6iBKdER0r0kWsOMJH85KwvcbO
wMBZgaoknsteyFvwxqhszx/jr9lkZHiczdRy/vXrc/GPALwl4iuMYRMEOFyTqxcT
jNIONsxFMCsB5p3AK2W43fEZUcoT/S9mM2SfVkfAQhAPzCRxr4SpYnmjZCIKJH9b
jShORUxOCPEPIz0uKYNU0nxDLoHW1y3gjor3urG/lcZSWSMcsNh8gcqcic6lByyR
pRF3dO+mCYv4axGi+Oe5U0WdPSGmpr8zJXzxBF4S2nS3WfZIG8FVowTPhKB/Oi86
PEhGhqWiWn8jSTBQI/N7NSXPs5J2WjL5dDyelvpMaxHTcnc6rJ3rGQyt4d+O9374
wHk/M/glpoxyiu9gk/VYwdUZTHyrr0DDDwfbKt6bqCnJd6012pIL5MRttBCC6n7Q
MVG/5DQ7ffJl5Woz+gjlNt/vtZmSe7sEaPouJRE1ZyCq4LQ/x/LHtkEBHqe+XPBk
Yv3atS++ABiTparshgtPXADk0vpwid5LBO1aJQN4hb6emztfRMMXrCDhdukOo3uj
coAcAQSjzKJ8b9FJ4mnsmHkrF5+n8a+4jyXSwoekCQapllEtm3iZUD3ue3i9tGn8
o34OPPzBFqouNlgoRmS5JyM3s0xqOEGxUG6Jcfx0v+QjCgRxsoIy7NvLaaXZdOY3
6wbcQ1n0RrXaj5wSwBHBV4yGx1Y0304NdfzQVh1y1Xra5qt83h6S+H6+VD121poh
yX0ZB+hycdsG4FfcHcbkD3ZzgkuGq971i3PZH+ybMa0o9o8dQu5EqhbzAJfsaH3S
vvyayjrI49rroFDLu/gYKlniw0L5yc9PQdRT/J9U/tadWYDE9lUB9SWgP8bh1jPl
mlb5Fn9myLeopgZZ2KDJhzoQ3BYApVA8L4A6KqaVjvtlcPwhq7PPFxigyKnqQEO5
CrmGnSt56sgKF+8gajGxUOVGEibqqNORVjcKi3RzqdOGO+HzyERObRcgJf/eUVU0
6mk6DN6EdEn4itEzzqGSNYlmRwE7gwUI5WZeHSSWl7FRDL100YOB5BN2TeaNyIJf
kR1tuZScT4B6LJX3jO0CUGWBIfvZPoQIzpn/w+E3MA+yTBqlutE75rijkXW6yqJf
as7Uc7ptYJN3nmFfX/DTRSc9x1iF60M+LJsc9PN8WlgHp0tBd674NZ4/Jod7xVn3
IPjIWKiXMyiOAFcRsKAzaYtK7FrZ+RzpEzzljCgBeBH2h5O946S3wqSeFPiIYfXn
60hg/gBt9/nX6zecgOPonVUJOrG+xpZR5cR+VFFYljoFIIU0N2E+3mgawUCDSgov
uOw9DKlg0ZscqMeSssrvxl9b6GWb1d4IZwiG40pP7VD+9qbSy4YwJ9m/oxZ0w+b3
3tIl1sd5Bkakt5Up7EZFd+X5hg8iRxWgd+x3CByRcvrRMOoQMb8+AwLON4QbtdLy
c5GfcQvM/D2znRdcj6fiEp9dGhaLeEdvZIh07Y1Ld7hcGVv84B3EyMH7znSkLLtO
cseHdZzKofhc0ZMyzNQ6QQ5/6qTzaHhpBwt9/vD86Evyc6HbIkC2qDt4kSBDZlDu
qKo=
-----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