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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIbfoq/pFJjhUCAggA
MBQGCCqGSIb3DQMHBAjGnX6YbXkPrgSCBMjjIFpwP7N1pnKgs9xNieOAFqea+M+U
MZWIu+iZczHypkEHnUtPnbYLj553Y6VPIwOPTsakNko6baWBiALNthArgdrY/JMS
rCtY/9mKE+WDxQHFNmAM7LrNDTgKbtAK3k+1ciuP7EDFGKP0Gq7Jtc2uSRm6P5E1
vgKfG72EgtdrmEeaEij7t5P2cRlXDrwR14jZbaJfOjPCOonwg8onE9XgUvNMG69u
3zdDVWdPgcFmF2xn6OQYghJQ61Hse16UiV99lCuy9+W0s5PtFff7GPmhQbeMMSFZ
rPaq1+doITa2J+iETIaLCfSHMuIB1WK5bwFSRvfyU4RECgaoeq97FuSqbKXT2rVC
1hm0zZpkZl5KuSwqaEGxUm7RqF0KTVx6o6zPGSG8+I9t3vuzIVUH6uboPknpiUH0
z7N7qoMkYaJlIhQ+vfTcrCf/UycIUdiLB1hNW28v/APd8/dPm7Zb2lvRR3PX1nM8
++PAzC5rplRBRbaBSHOjjsaDd9TzvI8KgcWQxbBXRAtOYGOvmKLfLyNKNDixwlBl
W5ejvOShMkJZwET/8USjkcEaTVhBofY/Lb2A460rJmc/epD6/vG5e5pEhStlwtpA
cCAusavYSF1+fBan2DE08Z3CkxKHpBaGdJYTzksYWu201ZB4G1P6UnMxw8UcU3sc
oYGk5zWaGRabwv4domNboGEXpZUzZBmg7wMr/v7LSjxE80b/QFuo21iZ8jBEGwDU
GX43XwECmhcEm/kVdSdxBz9TYP3X4d+XDywv/LYl+9nw/ditgMQSKdBUhqrovkE5
I9E+paxeQ6vkiXkCJ5OSxK1clsTouFiuVfUwpaK0XRSM8XnArkPBU/sS+rFMQOcV
tAtOHaK61AJScM7nvUDHdWqDTzAmw6zSKebx0P+PxcbGFcQCvI2ozPSX+OVXPaDp
+A3WLkEX1WnOsBF7nfIn1/3Mh26TER9vS8VuBe4Y8KecyzkvILz4DX/lu9ZssFef
HFc3EfCmg16VKrDQmSq61MnlRA1tfIJX2Rbi+AZ6CHOWI/GLNIZT12Gqh6DSIMVm
jiNuy3MAsRiPG8zreTlMsoX8r/41K0MGvqQZNvLtSkJJ49bVFcZ0TLU3CS5EB59T
TaICRT+wKkUvDsN8s95qLYJKiZf1ZVjw7ab4CjzlFFmgwEzqxP24pu3/FCjJwbiA
bbtnlyzB/bqg81EnJOVvLSrFTA/8+MM8pz3ajeUdS1lO94HIAPbO79MoKkOtimIP
Ep+bNzKjVT1v6VZoi8IDKHE5R7I4UNY9sShOpDF/A8opZnm+Z75LqxB2dfvsg6uG
3ejC/yatKfp2F0BvsVO3n92+aMvIcETH9+iPaLEgDuqui6YGVY3pPyDc5fwsSHBm
0PM9o629kaDDsmEM4B6ZzApwmIJUHzCMLaD5Fw8tm75Bu/pBbUCF6Ttoe3BIvanG
SZc3T6FRljayUDdrvMMOQWYgQrBOFykfSa89rI1Dtb1V+w2aC36SiLLydrHaEEBp
rjnUJoPOxw5Gu2SMMTZHg2bt8gt3jmaFh2ejkXOJvRZULJsHxsr5ZmyjloW61Ev0
2diVF6JpU0QxwnTxPARfHwIVKfLO0cZ9cu43gNQDKGG6rgrweU/erX53YNKw8Yrj
WZU=
-----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