note 85475 added to function.openssl-pkcs12-read
| From: | bromatom at directbox dot com | Date: | Mon, 01 Sep 2008 19:18:46 +0000 |
| Subject: | note 85475 added to function.openssl-pkcs12-read | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144057@lists.php.net to get a copy of this message | ||
To extract the contents of a PKCS12 file you can use file_get_contents as well:
<?
$certs = array();
$pkcs12 = file_get_contents( "pkcs12file.pem" );
// No password
openssl_pkcs12_read( $pkcs12, $certs, "" );
print_r( $certs );
?>
Output is:
Array
(
[cert] => --- BEGIN CERTIFICATE ---
//snipsnip//
--- END CERTIFICATE ---
[pkey] => --- BEGIN RSA PRIVATE KEY ---
//snipsnip//
[extracerts] = Array
(
)
)
----
Server IP: 217.160.72.57
Probable Submitter: 77.191.25.5
----
Manual Page -- http://www.php.net/manual/en/function.openssl-pkcs12-read.php
Edit -- https://master.php.net/note/edit/85475
Del: integrated -- https://master.php.net/note/delete/85475/integrated
Del: useless -- https://master.php.net/note/delete/85475/useless
Del: bad code -- https://master.php.net/note/delete/85475/bad+code
Del: spam -- https://master.php.net/note/delete/85475/spam
Del: non-english -- https://master.php.net/note/delete/85475/non-english
Del: in docs -- https://master.php.net/note/delete/85475/in+docs
Del: other reasons-- https://master.php.net/note/delete/85475
Reject -- https://master.php.net/note/reject/85475
Search -- https://master.php.net/manage/user-notes.php