note 127132 rejected from function.openssl-x509-export-to-file by cmb
| From: | cmb@php.net | Date: | Wed, 25 May 2022 18:00:20 +0000 |
| Subject: | note 127132 rejected from function.openssl-x509-export-to-file by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218525@lists.php.net to get a copy of this message | ||
Note Submitter: sladfive at gmail dot com
----
I m trying to create a Certificate CA = not self signed. I 'm using the function PHP
openssl_x509_export
For create Self Signed certificate noone problem. But when i must create a certificate with
Owner different from the Issuer i don't know how to do. I try with this code
$dn["issuer"] = array("C" => "US", "O" =>
"DigiCert Inc", "OU" => "digicert.com", "CN" =>
"DigiCert High Assurance CA-3");
$dn["owner"] = array("CN" => "twitter.com" , "O"
=>"TIWTTER INC", "L" => "San Francisco" , "S"=>
"California", "C" => "US" );
$privkey = openssl_pkey_new();
openssl_pkey_export_to_file($privkey, $keypath);
$csr = openssl_csr_new($dn, $privkey);
openssl_csr_export_to_file($csr, $requestpath);
$sscert = openssl_csr_sign($csr, null, $privkey, 365);
openssl_x509_export_to_file($sscert, $cerpath);
$src = getcwd();
with no result
Someone know the solution?