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

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI69g+ImqBuHkCAggA
MBQGCCqGSIb3DQMHBAieThHZA+BT/gSCBMiTzaAeaSyzcpFai2FI9OEdPqwJCVfB
99RZMhdEhD25R0zmp8M7DKkR3u9oVSghSEYb2iXKgXnRU+hG9cdeL5Xap12ZYXhp
1y0NHQYcs28X5hW4CvZJvBHW6Rh22jKP5v4eaGHox+GNOCMJBY9/dKze2AhSFmtX
r6F++eW/8zM5X1D1iEs3+0OGsYYTsdA8gOZ0jPkZwSvSqxZuzaEZK1etwhxa/iTv
SfWXltBtehx8GcpKQI1uF5E58GaAmoExSxS1cxL+aClvHA8yUece6/+gOo1S/H7w
7xcOYaLkAbeO5+QqZfUjDt1510iBAs+C/WbVUep4AVoecVjgFHYrn+emxMucBaos
GhN4bjhdd625SzU3KYidI5K2jirp042vLbAgJnLj5N/f/ih7X+SasfxgD5ZCbRt1
6jJov7zaStojihIaEakyushZKqY/kNSehJkkwcVzxR/jZ/OK8cUOnCGtiGMuE3+Z
scWFuN58FzfFQ3WkClEu0pawcobSPMVPmkYd0abU27rWMwvan6LxURgUuli+a1rB
ZmcZwVHFVCjB9a+u8s7HecQ8EArP9V/HC7hcpeGFNogDyGkV3kq476t8A+Fok9V8
lcIMQI/Pd4NfpQlb0VQm7NIGj0e2A+viq9X+CXPsKIkg+WQ2dgZOkPYcSsE7TI3Q
qa+n4iP7PgvKiuvyO6vr+FL9JcAgyuVx8om0zndXhRM2+K8r8raLZZMYpPRIKRzS
42dmLtXlHZoOF55wVSmfghMvfPfDtpIJO6ALZymqpfVgiL1bUvg0V0I3DfWLwwvL
cVVRdirXM+ElHRM0FDMXpUvKMcB3/mQt21Uwp+cXW5NZdsl66aGk8hrqhAjiFzp8
knjlk/t5BnAop/EA4nJTOJCHE0N18orYrb1ZmsGptKACipgGKf9CoNtV73unAbpF
4VStXYO3gP0n8sJhVlk6Uv4VLBHz0RanCMzGppcFEHGLZzTKEVeYTmaeyFRDykeP
Ied9+BtDC7Gb9OVRVUo6YmugS3o5AX7ELgkNHsaeTC7ZU1IppbTHvpZE8Bq3/6dp
IZL4Ei3apxUEIRH/SBNAt08yd8VifM1BB/+XAwloOy9T2SIFdmXf/hafXNYc8ARy
hNr/ECd8TjPO0J7Xqrn5N/zDWzLhf6goJNQyZnOM1Rc8qaUq40HRcxBKsXqFVP8R
gGYzN9rFY7BWeT7R8uE678fCQLnPgokbN/+8s9PZoYCctKNKw8FQk5gMcva/lMxe
QzR87fMrW1IOP1eIgcc6wVL7968/m+wo8yKoQBXeTPDnIRaXx0pflQmzWQueB38J
bQPXDqPH04vr/P4HcvNQLtedYxBFO360bveZ/V8lF0qFdQswSsIrPhDeYJ/0X7t1
wk7jg0vr8tkG7m6O/0MXHYHAISh1bVt0E8HQM3izP+Lsz7VpELSykoP33h2dcEEa
PiMt6zJvG2ceEC0t0fxNd8/KOURJsUrpTOWHUL7PrOYl4BDqCLPorgkVapZTvwxz
JX/g12GQ5QXzTG33lK02T5p4HFIpV6SyCcrkw/z+2eHY6DgzbApyqFXugwv5dXpX
qCRXBNF1b3gNgvoX/On0GTPWyQljwVrmdy8+Nh9WE/LPwIPffBwrgW58eXuionPv
FyY=
-----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