note 85492 added to function.openssl-csr-new
| From: | mainATTjokesterDOTTfr at osu1 dot php dot net | Date: | Tue, 02 Sep 2008 15:08:23 +0000 |
| Subject: | note 85492 added to function.openssl-csr-new | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144081@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 217.174.223.124
Probable Submitter: 82.127.45.130
----
Manual Page -- http://www.php.net/manual/en/function.openssl-csr-new.php
Edit -- https://master.php.net/note/edit/85492
Del: integrated -- https://master.php.net/note/delete/85492/integrated
Del: useless -- https://master.php.net/note/delete/85492/useless
Del: bad code -- https://master.php.net/note/delete/85492/bad+code
Del: spam -- https://master.php.net/note/delete/85492/spam
Del: non-english -- https://master.php.net/note/delete/85492/non-english
Del: in docs -- https://master.php.net/note/delete/85492/in+docs
Del: other reasons-- https://master.php.net/note/delete/85492
Reject -- https://master.php.net/note/reject/85492
Search -- https://master.php.net/manage/user-notes.php