note 107360 deleted from function.openssl-pkcs12-export-to-file by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 May 2012 21:22:12 +0000 |
| Subject: | note 107360 deleted from function.openssl-pkcs12-export-to-file by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187879@lists.php.net to get a copy of this message | ||
Note Submitter: jaunakaste at inbox dot lv
----
Documentation needs to more detailed description!
The source problem was (similar to this: http://www.phpbuilder.com/board/showthread.php?t=10321977)
$exestr = "openssl pkcs12 -export -in TEST.crt -inkey MY_PRIVATE_KEY -certfile MY_CA_CERT -name
blablabla -passin pass:MYPASS -passout pass:MYPASS -out TMPCERT";
that there it is possible to define "-certfile MY_CA_CERT", but not any hint how to do it
with this function.
So I used to generate p12 files with openssl console tool, but once it got necessary to do that with
PHP, there i spent a lot of hours, to figure out this info:
Here is example:
$args = array(
'extracerts' => $CAcert,
'friendly_name' => 'My {ID} CA signed certificate'
);
openssl_pkcs12_export($signed_csr, $cerificate_out, $private_key_resource, $passphrase, $args);
the $CAcert param, can be only string with PEM format certificate (not path, like it said in
previous comment).