显示文本框

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-----
MIIFDjBABgkqhkiG9w0BBQ0wMzAbBgkqhkiG9w0BBQwwDgQIXNixSPns2agCAggA
MBQGCCqGSIb3DQMHBAg3C2Vi6SqOxwSCBMgX7VlCibvdaEcQ8Vre6hQY9p0VEFmN
azhYr6X1QrUEBNIWYbt6RShpAa78DxaQf7krypIo3XbVISZ0fYYILmG56k404Da+
eHcX6BTgc12wFCriDbx/FYZDQXMojlMoO0mMUXBH2k/q6RZW2OqZ1l0QwDtTFscQ
mw0OBOo9Ev3LslSE29VxOTwuXkKNdcLfmx5T9fmIvRm3dah2wzlXKMR2rzuk3igK
fA62DNxpbrM9I0M4UdQTSTPFgxzNv5seQHyOneS5UcOjuuZ2RUjcy+jD/VIiwT0n
QvwyaUAy97ivaIzJarJINbuUzHIpBD5W0CTGtV78g0WfKXpakzxyvfDlZIiXV7cL
alJQDApULxZcLFXbUkb9KuIQl/t1b36VJn4S293URdORR3K/NUva6fXBr8FzIo43
AUrJTRRMUPdymSY7dhbVl0I57qOXgWXDIEGaKjAO5m90VcIBHQ54IVl5lr6nCUnQ
YNnIoDynueQSbzl0VpBJeOhkWhPPUl0tIIHBTLm1z/t+0GXNw9BP8/+/CZ5WTtTL
4GfMS95PiGZj+hfzUH5YGjdMLl8sC38PI5KAX2RzULbzlKJ5AWgc16OUQhsvXeWS
U9f3pjAtb/QjPQzw/4mpGijjLsvdao4YsY0LAj2wbFO4ptzHmFEd73FJH/YVC0VD
7h3LW3Ll/Uyx62NQDSMYzETFeU1n1d2pdQaTDo6MK+XhvFSVwQ1BTCnRvbNwXWdZ
l4U93GeJywo9gf7XsHlAW0NQTB6BvZwvnLgrH+w+0nXUyQHaIIlq9ozHex90TKBE
Mj4uFh/QCzjJ+RevzsAkkd0pnyvVKymGgbczv+73TqjHOvU3Yo0kzYpLRzVtIBmR
QGoF8Qv+BaCWcD+4i3nmBLKKWMdCj1YpUyPwok2u5ZGiFuPfFTjb7FR/GoTm3Wxz
htZrnjgagztr8ZHqNP6ssY1b0/7LREAf8oVgKPGqPKh2jrgnFjIKENB/lHm4fAv8
7g2JD4Or8iMbiVrvDicdhLt/yUN0ZZqMb6zC3Jwe5TGu8eb7XdbQwxIqAL+TehhJ
rvWtmDjLdicXDVA5TPyj4U6gtNizNtbkM+9qKwDPcd5DHcVSRk8i6i7YAGUPxsSJ
kYwkT3TEAmzCRgRA2/GyFlii+ZtW63b1vbJ7+zBTv7+GzDYDJYSnubI4/ZK9NFD4
PRRXNrAxX7Vy8u6pFuun7Y9YUm9Q3ifxjzg/4Mjgokwx/qHkdRnP4GAjq0YcIlDS
OnSNymnEIzUuPCWi5GPmyVal+6VG1a+aWAaY+0TTHKVYAZYhzKv1tqeITgjcTA+n
2qnp1/8PlvjC0xNRi6fam+uyyOM1fuoimbH4Bpst5gU2w3KybnE8JpcPt0PR/XdN
O4VIn2xUFNa3vwzT7mWHscn3LwMcxL0Rbeu/ur6JpwJHxWLSWJG6w7yJp9gWt+P5
G4Rthew+0a9OoI6IKmHjyEzpQxvltG5TjInR71qxaW38O0Yo9f+5XbfHYA/DN/CF
3SkQrXASgMOOPExWW1ZjCaQa0CvmqIg9sbBZPAUdhU8AoLeurOFp5xeRUtDsOWw/
ZBzQmmugOJEK/eggsrZ53xDYA5sOQ+F+sFf9JrahYmrrzI9/LK8FNRid3L5kuYEL
C9o=
-----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