note 107360 added to function.openssl-pkcs12-export-to-file
| From: | jaunakaste at inbox dot lv | Date: | Fri, 03 Feb 2012 12:34:34 +0000 |
| Subject: | note 107360 added to function.openssl-pkcs12-export-to-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185839@lists.php.net to get a copy of this message | ||
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).
----
Server IP: 69.147.83.197
Probable Submitter: 195.160.171.122
----
Manual Page -- http://www.php.net/manual/en/function.openssl-pkcs12-export-to-file.php
Edit -- https://master.php.net/note/edit/107360
Del: integrated -- https://master.php.net/note/delete/107360/integrated
Del: useless -- https://master.php.net/note/delete/107360/useless
Del: bad code -- https://master.php.net/note/delete/107360/bad+code
Del: spam -- https://master.php.net/note/delete/107360/spam
Del: non-english -- https://master.php.net/note/delete/107360/non-english
Del: in docs -- https://master.php.net/note/delete/107360/in+docs
Del: other reasons-- https://master.php.net/note/delete/107360
Reject -- https://master.php.net/note/reject/107360
Search -- https://master.php.net/manage/user-notes.php