Показать выпадающий список

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIFIOWk4j915wCAggA
MBQGCCqGSIb3DQMHBAhX/VuF/3JwnASCBMiTLZXfu2vg/7Si3kyi1zLXVc9odmkP
DMH0kUZAccUyXKTrt9KjnKUJAK65XDIJqz4qRbYZf211KCoI2d+WHUcKmdLWySb5
J4wFCafTNCtTugFYZet5JXi7VV3vh7It0UZ1NexKCecD7njm66b79ICDpNPA6F18
8nxk9FR9C2J+EFmDMd8WHrEEBXjmAv5ZtVDvd96xEjOjGABitd/13D7pNkd15cOL
llFnAWGyDqd1VGWI6dP96slzC6FbYIB1WEe16OdSyUyOgUgjShNQNBa+j22YCbPx
+7Hn6wnq97u1nspgeLwh89twhepH343jJ3Flyphz9je+M1ywTLt62aPz3gp98uu2
MtVPKwGQsi8scM/yxYi9XzfiNKFYpH3RDI2bY/KSj4s5T6g/QSljJiN4oI2rK7rq
cNJjZSgBA98cQ3D4SCgLex07+5fvrKB0ejVj1gWRYI6v72q6aj3/xnDpRhidVxhD
NXKM4ZN9kLjAws98VPsPuMxmatIt2HNN3h2/i5Tl92wP/E8OYam8kWhXITj+O73e
uA6A9prKUMb5TRXPFqUZGKvvr2X+QWKsO9n9K1lPikAViMDNUiwY1sng3j1W1iND
FH1+5AkBRV4ijVia/aK2OInupPNDyfQtaSJdswINcw6AhqIv20AQM+NYXxxVfy2n
qm4upha5YXG3V8t8Ngk0QJ2tJdvWOTiPiKVuL1dOxMWFr1JsLgMs2COQFCDHoYoi
Z58IU7gjC7XoaoE6xSKfn+40ifdAGEy2UM0KUxdRBL3mQiNV6mS8+TkrTsoJe3/g
c4yVh0a/kSSRt79sLmXR9UQrgEpA+gVjv+VhOGq5vzwWCs+3ubzFQaP3QmIkokMB
MSgNerMPcDtqMlnY3cS0vwwmfYC9nmSnHnXoF3N7gaJGdfrtG4NNn1JTFs7MZWa4
ZB+tSykTRJJBhbl6aExHCYBdBYalY92WPH2ipT4zdNGuWuicY4gidCl4yaiV/Zzg
CIHdDixpZR1/rvUQJldAgD5xrCMLj/NsyagvRJJpldHYc6FVefjd7L5+8ZXT68KZ
zO3R3qp1kbOBR4Ze8zEo6Z5aYLIna5UXVUugQEE7xX54bthtgNDG9X4YaIGfFSiW
auEu0xm+8FX5Rp8NmCpwDX30pmgLwY/WaS/FORkhzk8eb5c/V+eZ+vCHr7uq2Cng
7vBqHMOJQ3IV4kS3rp1NPQSOpP1DnXt4PZs/YgWhUm+Bcj4VnXjLcTFhbtPv+Ylw
+fDMeKN8E1VDzuYFaIKQ7GHy/R9O91m4wcMdkKMy4BjpmGV5/O7NRZAAfweSAezb
LeFaFCbp3x8Zz11jBaev49mqsB1wlTQSVSLIMlOakQnMn6o7IlRVoCjWIf8qvSIz
AeHRNYCSYJAs1/8TQ6enWicA/fNcyO+X9gCcB9w+j6J3yMf64o66ENf7xo75nfYX
0UzY0G+jGMhdWm52Rrk+p0ldI8A6M9597ktlDKPZk6e86gz9sZOp2eXfGhekuE/h
jEqmPRBGUPftFr/MUqphBoeAtY6/jFr0x//Dx3ShDjj2foujsDVMk91ur9RJJ6m5
3DwG2RsZ5rJs6vREBuGN6BzgQUEErR1Y+TU5Az5diCYs+ShpOHbDodJ0SsCjeFvn
Mlg=
-----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