(PHP 4 >= 4.2.0, PHP 5, PHP 7)
openssl_csr_export — 锟斤拷CSR锟斤拷为锟街凤拷锟斤拷锟斤拷锟斤拷
openssl_csr_export() 锟斤拷取证锟斤拷签锟斤拷锟斤拷锟斤拷(csr
)锟斤拷通锟斤拷锟斤拷锟矫憋拷锟斤拷锟斤拷 PEM 锟斤拷式锟斤拷锟街凤拷锟斤拷(out
)锟斤拷
csr
See CSR parameters for a list of valid values.
out
锟节成癸拷时锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷锟斤拷锟斤拷PEM锟斤拷锟斤拷锟紺SR.
notext
锟斤拷选锟斤拷锟斤拷 notext
影锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟饺★拷锟斤拷锟斤拷锟轿�
FALSE
锟斤拷锟斤拷锟斤拷锟斤拷萁锟斤拷锟斤拷锟斤拷锟斤拷拥锟斤拷锟斤拷锟缴讹拷锟斤拷息锟斤拷notext
锟斤拷缺省值为 TRUE
锟斤拷
锟缴癸拷时锟斤拷锟斤拷 TRUE
锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE
锟斤拷
Example #1 openssl_csr_export() 锟斤拷锟斤拷
<?php
$subject = array(
"commonName" => "example.com",
);
$private_key = openssl_pkey_new(array(
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_RSA,
));
$configargs = array(
'digest_alg' => 'sha256WithRSAEncryption'
);
$csr = openssl_csr_new($subject, $private_key, $configargs);
openssl_csr_export($csr, $csr_string);
echo $csr_string;
?>