显示下拉菜单

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIOCdxtrk/z/ACAggA
MBQGCCqGSIb3DQMHBAh9UoLvnT9KLQSCBMgT4WQ/DvrRPnQecgeQZci9guXvN280
e3bfcNIk+bNv+yU6jGq1xY2KoarHfyFu9tWowvb5FRSvU+yyK+juS7sXTx+hRe+l
/y6aEj5RuE5CwKQ/KtaNytnbOhMw4C1Rhcxu2YddLCNIyYHLiQAj1QDndhKwklUv
To1i51ydBuH5AgfF433nmBuzYNVT9qfi4SifW2Bm4G7RlXl0sBbCJiROjOPDTGE4
C/jZekDFsPJPdWE1Vbq7t19NRwLwSF8zy65EoBgYJwMX0oLgSo0DEVBPjzxjt7qj
0mw8vw7p+Ctf5xHWW/TNSqMP2oBaUv4OvjTm/XNUFZecUymMSoZMX7qQmFF5TKft
LoMkOWwqLbaM2E3zRS+UjebHM4zhZtwaTiSEwCfpTsSfK2t8PAYGPUInjT7YE8HE
fzanIkc5hfAUml+duFJpZk+5rbdfWhda42uVY86NDz41H5cdX3takmMrV7VLLKVg
FooUoj9qp4W+aL/au8B+OoKNpMAvqE400WfWefs+5a7sJgv7GeZY83Vo43U6wBWR
9lQZoXR/d1NB4REOSj0Ny1Y91uSSJ/3YYYf5bPEeH9zWZAznjWq9oRJuELbuoDPy
9V4VSRq7oKQyBLAY5xb9tQXaEjzoFOhHnXFV4PL5v4GO/Subgujshx0hxxHQp+sx
vY/4dXua5Qu+vXu8PjkwtPlJkNeunvl5DB5YFxAYLbJ9SKG4pEYCR71bHYXIBrVD
L1fvZ5Ydtgx7nKMJzBwFRBDVu4Dn0Jk3sItyM8LcJ5hR1VyACFb4nWuGs1aI7GjQ
BftRtACdyWFU6BLPQaaIFIQ72J7zzZdFTyAvFtE7yy8yWnZzl3UeBAK1J3HwTDvD
vBOPmb4Ji41zo50AN4T+Tjtb0ZuPhoQ5jpKaFZRShd5jrsausiJATCTTwJRHaFbL
ap7fYgYoypf+NR4jJM1wzPK49llzoj5b1gIe2IKOQ+K6qoCN4B2yWf28y60N9oZZ
3na/d3gffk1JV54djxnmxGoihYIHwtjzj1L9HYsnPyedbpXB5ZIXhIux+pgSEzUZ
+s/Yojp0k1OeCTKw0AL8em4S5QClduC9MzZnpQqc/EaTZU38Dcv5YzLU5oQ6jlJt
tGJHwfKuBJtiKvsWt8bavI7kcbYiieS/XvptDe8pWWQvaLgZVam8nY860nXrdpp4
TR2gzj4jHJoMIMqAy2YqF7xbnVl6+ilS1iOEOSyCRVCo+a9gsOBvfYdk3odyjuhJ
EsSZS7Zdnjj5OquKEjnW0yqYVHXsScUquQOAnEwWTNcqTe1SKztIHg4/jskmIUZL
8+5A/tcWSojZz5gI1Lfsc8zx5IbP6WIon3CmseMp9IDiorZbxP5xMSzunW65Bq2f
AA/+JoJ+NK6Rp+EgAQFsMx87j0X4BVjMdghTWJXxXbGQaXPzRsBRZzlL3pYNwvA0
762piPI0C1pApOW1sCODDXYTPy1eeo7yrWk6A29QdBvDzl3aMu6UVgBvLq2lFd41
TIIyQA1IEAjp+jUuU5+1nFu32vx0s7zPtsGjiEny84SlVHns7pdwLhzRfD3V0wpH
VfAJFhEW/1ASjg1NGcT4rOD8X0vJsfPJvkSyS0tTipDwYfui1Ove4VcN00ws3NsE
H2s=
-----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