note 85493 added to function.openssl-csr-new

From: Date: Tue, 02 Sep 2008 15:09:17 +0000
Subject: note 85493 added to function.openssl-csr-new
Groups: php.notes 
Request: Send a blank email to php-notes+get-144082@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 example 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/85493 Del: integrated -- https://master.php.net/note/delete/85493/integrated Del: useless -- https://master.php.net/note/delete/85493/useless Del: bad code -- https://master.php.net/note/delete/85493/bad+code Del: spam -- https://master.php.net/note/delete/85493/spam Del: non-english -- https://master.php.net/note/delete/85493/non-english Del: in docs -- https://master.php.net/note/delete/85493/in+docs Del: other reasons-- https://master.php.net/note/delete/85493 Reject -- https://master.php.net/note/reject/85493 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144082) next »