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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIR+QoL7COiAkCAggA
MBQGCCqGSIb3DQMHBAi4A31ScGsjcgSCBMhtgAv5AzL3h3A/GvNQf9vN74gHs1lI
vS2rYDC/Fl+SrhsoaVEiwsymYpneos4Vh5icZgDv27qnZ3nU21XVODKOuU92mm+2
xpe4zjVVxe9Yo7XnQgBg10oU2aa+sEdgVrYeeovHwnobP6RpWTzzg9mpdFkft5pO
CpE6nWedd/dyR24G6gHtiTVdtI5V+n4pFESbnWVQHaMlzvrbfzSNxzqydP8KCtK0
04tu2EGrecTpA55fAKGssGfOfP7deBXr1ImAYmUMPunPanKR2eYbHT8vRzEdZwi4
RpFAG1imXBqI8PgaSOpTtqe4vPQVfFqYPRRAHepAJYmOKi2A2+X/9Nu2yR3zd6Ap
uDjZmyF2sS/W0RYKMSfmHuPgFrsTEWN/3SWlfrpZOcqwZrQFB72BBbz3VZCZhuWt
LR1epV8LMfqKP44vhaFkiB+jqKzPNQayFCqmkiPMvJayRArDBAzl/2rkHDbBE4+s
jL+savC4Zjg4XYYJClkc2KhDO5KscsbKiKj2k7X4+vAYIsDAbv16DCwUr0X8xrlt
J+9jUzdD+2xOJv5kPgdObeddOXQV+ADnQ/Y+yYKxh3Xsvi68os2fBi8QqKjr/aZR
jjaekmN6HqL3Q4h4tyfEWE/iHCDZ8vp7LcYIA9ojuEzrOM6h50Z1XNjcjAKo9CVl
u9gKPQ83/tvRgSBWxa0q1UItzR8+B/mlK4lsC7//tRm47/VCwFZr1lQbgMdYTIQn
oLmP91PL0NlL7ruM5FfFS3FCgG7xkbyXK2ZoJfZjYKJvo2KQrD7dWjGCeobdFoEo
gE+8pV23p25+rKBNyHoG2McDOKTiRUQH+KbCMJTWmhQZqJA0aGYXWYBeYg3LV6rL
HA/3MmpXBt1xJTpVZr54WpqwIq3Jf+AaxOoJQMbKjlffRi5NXKvw1YbHdCp3gMko
mW9J+ZH9q/V76ffPxFTS0m+H0L3ZwWJ0sEd1RU2JR8RPrfBuSlYjRQLDEgqbF8IG
fvDeoGkub+fguDuMLq965ffToCo0ZdfgG2ED9kprEGbd0zJCLJbNHsmARtlM8wIU
sd1lBZDKGgn9H+WoOKmJXx1YTl51CxtO+Iyil4h62CkJOCffjzwFrhrSv6zktYZu
PPMHOGo/y9Gt/cnhUJwsb4hHbpBPHVyZ6EOhoQmbESwHLT+AKTlYw9JZN3roLu3t
c+NPw+9o34Tt7lSH1FzkguPAOdnTsuIt/4nKXdOUS/EJup97s6DOSzybcBOvF5Yl
PsNPmwIqbl3eQP/YsV2xfZIOehD7XdoU9+NFWXc94y/dPDszP10tmhvXFo7Rzb0k
H2LAouYltfe+91X6BHcKTkrr+vvUC1j4SgewZlBZPe4l+pHlknVbCCjQGCp+2zk6
trXbNAEpUnDIrTg/8m2SleiQU4f8vMUrkVWpvR9obncrRzOz0yaGkn5xvSME+98S
4+aSE48rnFFL3n/8ez5+ec/QjaXHEPbka6OxnWKkTDF94eg7okJBAMjwKF9/Vm8r
qkynnKCwsnOuSAe0qqvMjYoEAIlSi3DM2ZS9eXNsCZ04Unl9fTCNj/T/t3c62M+U
apNB+MSwR4SFdSCeTTDfhgKsDvKmoD7e7TykKqIvK727Opa46fzcxAe47fYmBfwa
Fqw=
-----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