note 85492 deleted from function.openssl-csr-new by felipe
| From: | felipe@php.net | Date: | Tue, 02 Sep 2008 22:26:31 +0000 |
| Subject: | note 85492 deleted from function.openssl-csr-new by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-144094@lists.php.net to get a copy of this message | ||
Note Submitter: main ATT jokester DOTT fr
----
To set the "basicConstraints" to "critical,CA:TRUE", you have to define
configargs, but in the openssl_csr_sign() function !
That's my exemple of code to sign a "child" certificate :
$CAcrt = "file://ca.crt";
$CAkey = array("file://ca.key", "myPassWord");
$clientKeys = openssl_pkey_new();
$dn = array(
"countryName" => "FR",
"stateOrProvinceName" => "Finistere",
"localityName" => "Plouzane",
"organizationName" => "Ecole Nationale d'Ingenieurs de Brest",
"organizationalUnitName" => "Enib Students",
"commonName" => "www.enib.fr",
"emailAddress" => "ilovessl@php.net"
);
$csr = openssl_csr_new($dn, $clientPrivKey);
$configArgs = array("x509_extensions" => "v3_req");
$cert = openssl_csr_sign($csr, $CAcrt, $CAkey, 100, $configArgs);
openssl_x509_export_to_file($cert, "childCert.crt");
Then if you want to add some more options, you can edit the "/etc/ssl/openssl.cnf" ssl
config' file (debian path), and add these after the [ v3_req ] tag.