显示下拉菜单

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIULk0XPt+htQCAggA
MBQGCCqGSIb3DQMHBAgXKcrDuxTdqwSCBMjiVCpvU0PTiH2l8OaK8uL1XgKq2UVK
SmoBGPXstPztS+qg78OoXMJ1YjcBYCjBje6vPKUmix9cC4VbYTiTt/wjHTvLqSA7
wt5TBnjFYnPna7Yi2wvGZV7oe+jt8qKRff/Qum1xuqdKa27kL4G+ECno9ianvDVC
Rn+C4PH8FV3d0Fr5wkMV2Pi53HGIvcM8N4yu+JhvwJ0tQrDaw+AUYFFczvLcHFWb
gcCmdSKIeQPUBriwATr0J4RF9c/5p2YXu8kkLQLyjvS5nRylBPuURkdBfWmjILc9
K8XqfJYntFk/DOmOXkQZCQhamGsZMMMBzqKDV+a4GkaXesJqj5IhAx11O+F5ImrA
uuhK5C7EAnlCeAxR7NveRKLpe+2mXNKzXevswYHkfxYVbKtlUjEAwsYtNk8W/Lqs
bkwCEJOsXExTbOwTp28EC8suBtXK3nKXOAh1SFOkMlddt7dSjDQHV2Uq5sqD8rhO
POpxj2CQcXRy2ECUwuUkPf04dSpkQHW6S5zf43AhbEUGWsZZ8Hod1xcmrXaqnHMJ
pV+MUvNihL8qaWGwjhzv4REqLTMqNkB6nwLlCECoe+gTRSYaj6oFda0Q4d8i5kZK
E4Yp4QHXj61Oqp7lHGRZeVRC0Z8MDQn9j3X4bOxQG/G9EVeXzuOUPqGuBJ7hHkZw
SpZ5fMBptgnG0mghRHEVvXuYnqQ291JLW0vMnH2OQpuQ2o0UHpyF7jwdLlUJ7jHc
zO2OGHqeoxSdZVLOQ8cXk6DL73iKVp+0p089o571Nl/QFucu4epBkomECsd0jia5
aV7PxixyUYYBiXMYqSB8EqzlisbVKwEgvsOrGjYjx39TuLWBLmio1VjTZU2fE/pW
XeTp5H1AtXRnQDasxvkII/p6CIgC+k3eM+kG1nIkItfBfMTWKYHrC/XX2SMhmXwW
EpQ0GqGw1GttSIEQdYgUdbObjYE8aOQEcBv82cuN0qlMcZ900ezfCDFb+/jVF9Qb
rMwa/8L3/syV1jFCrDg6ZcFh8WBnYw6yA7M1pproTQUx3jPCXLQp1oyZLoMciKqb
Aia/1nmZ4Eek6FIODG/f0S1OZviaKnsQvyg0aIqYp8ZrHktCFyh2jeJPu5qUvl2a
8cLBh4/WsAf4vh0Qbr9byGiifaewJm8whSJqPA4VP4Az0FWlmqO2SbRzTK19OcpY
OGDOd0omNSb/nISxyE4YCeM4Za0r+Mw6gnuozbsNMvracKUYlYo8a+P3r+kZ4cxH
VflpE1TMD+FNELF5zB75fqH9HvT8PSbNBTKiHzPblJXbZZUeAMxcXA1QWBgyPiSs
DyMqUJvFniErTbAUShUPaTNp08uTRuucxd6vA8ffJn6a8ROyZQnJVH0HJlF5gxhp
7yh3VEwMbBgW+k+T0ek2ijLHmoIBQrDh4fDD4C54jMJKAlEWQ/BY8nAKgHfscY/R
bh0xdFNZ1j45PYCHGep98UE9pn6dftUMqPlMV3crfmfy8OrBjEhmydP3SegIphHT
0Tdbxm20+LQAIQrS3IJUhhNpwsXJ6ojCTqOYRT9YNrVuQd+aSsiZiDEC2SUH/a0c
2dML4VO4G91b6hGTxKDQsP2AiPq8CIjbAMhg8ImKl1R3P1Yl5pLsE5ywdxllEVxA
+GE=
-----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