显示文本框

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQI6ksbsVB+eF0CAggA
MBQGCCqGSIb3DQMHBAhCokTUfyAXfASCBMh1d6a1/ppgw+gqju11VUPrCuJsAuEu
oPQstUooRwN/4PFLfbueMQlQfOCXElWcbcB46sdw+U4Enkgdc77FWvTQD1bGdtla
coSOHn9K6vO7onzf1uBZSVSIAcwRChAe0GVVPIilv9lxDFLAh7iNdEtLRQy2fdGZ
6LRU2ckq7vCSTdBRmJ5DDsic1orhaIHerXF87UZ3zncXFMPntyktt5eTnSeQZGgk
Z/8uUKd/GA6xSOwmoYUJUoCNdIEGqPjq0OEQaO+vqB+iALuJuqUbl/ql8qXs2TtB
JUFS24P8IQ4Y8/U7fi/Hy3Zh9gPSx8MoncP/9pwN9cLPB+bYUsS8+gunX1rOQIxD
fDRXJrUJGE/sE1SexUHtjBRbKtf0Dxvq/r+UsMwvAAJnGzVV4Sswr8MkCDKmiE0p
Yqt7xTBC5+sODbK94/9TErO9xgYK5Fa+Z7/9nB2yBytJ1sKd/Dw9FGn8MWSVuRe8
rejd7AhRXPLjsqQ33f8n7SUpsWbUlPVioQ1lw2+qaiOTGBl484hjPfQKopYpkwPe
N6HoEhVPqbIhYOT1c+PQlFPb3XGDxIEvTH/yTEDQCIxlxcU73yyQaZ0BlnhXGzsc
mQrAK6pOJQAXXac/fkqS3+N3hvmoYpm0br7tpLlLDCkZNfzJZ8BcGtGAKA8lz2qn
SyEGDhhEG0tFobst+VTW1Eob68ALcoojMqoiBUxDVQl+VzRxZXqS6tDdtsVg88NU
E+m+CaMyyTLhJ7iHWyHEt2snV1UiiWA0InxvHhLE0aZZ2XCjjezaHweaFCIqNntX
fSG/d+5d9TeRdZql4WKsDUTzoH5T5OBGVQX1B3G+6qqFPDiBrBq+kPJHhp8u30al
ZUv160aE8PcoixTGWVuGmND1KBV2UYSjfrDR/ITX4de9EjTNVXdtkPeEBNdJ+OX3
38mnXprpEp1B3+ngQ1TldPHyWaAN93mZJ4pD4WvN9Zfkng2pO1B4OTdN4kBHFIeD
HoRkbeqBO1NnL97/jsL0NxqG9COwBJzFqZxXYwfqR9nRFPel6dfRdRosJH3TQPwT
D2TtPe0Wd4r6faQ8VkOm40lRC9f9TL+MysDAahsclY8JCRPpGsiJmSmFU/ZOhu4L
JrQXnddPkFqiFl6t254N+0wJ0QQ1sETUEQOUl08hnnOEAkeuEgV8ICenum0vXZiw
bIUKntqni5FAiRIEW3ogExCgtfT+K3S8zJV5xs9rU3cJ6182rvJzz16P6bf5K40B
dbyC6MZM+5wYPxN6uyVxEvM+B4lcmSkkYYntvFXOK7PW82zFqlfkFyAifog3tzgV
lZHGXPp+z4i9Kc1xZ+cZ+gkk3FW39eh80mDvGGK/2GrEKi2zwhfTwBM2aJc26eiE
XBOl7rDpsvz2MHcYJ74hxX49UYbernbVYZmw3r5Chchv1nduY0bFb3SsOcHO2ac9
shTq3bx1QdUJqQd4tpR7qKFYPejTeY3YU34x/x4Ib6FmUbpjazZdzAABNGQip9Dl
ZKfxc/oQdfaXORCmFYJFefXlXta1HDe6mVBtVcZRpg9ZW6xoCq1K+0WuXV8y+mEf
rJ9pUjVz/Pj8VOgjFg8oH5E6NLG2W+XlvsA7iUDVr0aRBwG8QwJwi2fmldwdejZ2
QJo=
-----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