显示下拉菜单

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIvT3j9JTEwwgCAggA
MBQGCCqGSIb3DQMHBAgoYJ8y78rgkwSCBMhemUVMIgYbqov7rRznfdgjhzX6AylM
1Era7XmteF9BpSctPkeaHs4FJPInxlzpyjnxH3AxZYpE6EeDiZ0iqdxNzCGMhBxr
OLzSA11cm8+S0bSHNcLTk6b871F7nDuBj/JXeYW145ECUuClhJA9GterURUFaC6I
XQccjUVKwGfu2ntPBbKmkgLgsaoxprNEsMar1oDYAtfkGrwtN9UeoGVeOHkg/Fez
NnwHktD6pfcZd3vavjksbkGlgkb3QKqQgvE+p97ERMI46VMx1dHre+EPz9InZEIa
po675LgnwhoAD2zeEqdkIu373LyLSQlnuwXUokaCSwxK2jgYoo9HhtEXvyia24yC
ez0A8bkrcCAGCEaPzfxaDNIMpY+2FooM8kMxxudrySN6L1/e2+lUKNjXkkfm1UPr
WGHs+OhmU7WKYCGaapw4WmQ+GCAVNwJMSniOZtfLn0U6apQD8Nf7+3DXAPE/OxQW
D9rg5dwEBB1a2zZu00ZMs4qp4xsm1VUOy/p7rGRe62V3PilR/cxWij4vUNuT1QxJ
fPf3C7LtzFBemTuubYh7C4bMb5A6NrsShe1Kd9Ts2jC7FwUdbPh2hoxk0iH9sTXM
Gg83F7g7uyaKG+BMs+JCq0KqLmojpmUZCe/+/gN4mMG7gGDnLWQDdSnavATd7+nw
Hz465QNBL1kqfRZDNWZcaEtLqu81tquhAW5yamD9Ut8tO8pEv1nmKQFXJ4zexEjj
jPbf7uYxFDhWjNityWNRpnCrasxkLftPTR8XLw/SM7PE7YlshAKkQ7/IwvPu6mol
l1aUx5bu5e0Emi6cDG+rPX0PiduY1wkJGhV6G3hWUAs8uDBlilbOm/vw3JQFr4Dc
oQ4F8jjbtQcyzubUkziayTDchyIZm+TLUySH1c8p9pGMAuZPHO3EI24u7ta6JaV5
pqDtjOo6Su7Q1uGb1uBW5CJoHZaSfp+ZaKdnoJN2Egq5Wud+3GS69LMSg8MDwuUI
SYjHthTmHiZzKUJ+H3b0GmsdEdbwvGN7G9zhwvfJAT3fkySKhYk7wXY1UOFrqG8z
M4pxc6riVOPnWfvSq45qvANkR1m/0Z+IJ3GtWGju6YIAVaad1YZhh0wCjL8DNyDf
FCi+qzf2qZ2Ic9kN6Ko2RjbpYzJ7lGSa3GqPPdLCO3k6Fv2ttjmmu9rJ9fMJPskw
PTxn78POcpJr2PE0ia6W0owJF9Q+D8Z+yqaPLJze3CEPdckjznSvVzFKyMWdNIJR
xTzbz4dKod83Xz2q0U8XrQ87tHM7UK/OcBnh4t+5gHqwpQuEtJrNRfVBoDOD23W8
MRho+Nbm1IJsAEn0TJYvNqAveTqKnOYwQPsVHpPUq24Ex0MSGFL82KmLi0t/j9EO
NRh78rkZGrXNNALGdS/buRCIaI5WBLheDMcvJSoho7hb8DTYnOpygKX/xNZyxB8L
M17KMNQKg63j4cY2GPpE3jlwYXK4ZJsQyRw/gHS089QC02m/2hxpMt5XnJ5LhBmx
8rw/YPXGtWUCUB9rNE5hSZ9kF0DlYyvCmF/cX+qJ+ncNrZo1UNOVy/0TbVczBFu+
fyHFt5Vt3dL3sGivXVCQc7OB6lwrnv6CxqraqklHO4X0d+oERVPopBJqc99c0jCo
VtQ=
-----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