note 88629 added to function.openssl-pkey-get-public
| From: | jrgraySPLATgmailDOTcom at osu1 dot php dot net | Date: | Sun, 01 Feb 2009 20:01:31 +0000 |
| Subject: | note 88629 added to function.openssl-pkey-get-public | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-150070@lists.php.net to get a copy of this message | ||
nice! thanks so much, this was exactly what I was looking for, saved me much aggravation.
the only tweaks I would make are to keep the keys outside of the documentroot path (e.g., on centos
5 I use /usr/local/etc/apache/), and to store the passphrase in another file (in case your php
script gets exposed).
$dir = '/usr/local/etc/apache/';
$passphrase = file_get_contents($dir."passphrase");
$passphrase=chop($passphrase);
$key_private = openssl_get_privatekey(file_get_contents($dir.'private.pem'), $passphrase);
$key_public = openssl_get_publickey(file_get_contents($dir.'public.pem'));
...
----
Server IP: 209.41.74.194
Probable Submitter: 76.204.121.248
----
Manual Page -- http://www.php.net/manual/en/function.openssl-pkey-get-public.php
Edit -- https://master.php.net/note/edit/88629
Del: integrated -- https://master.php.net/note/delete/88629/integrated
Del: useless -- https://master.php.net/note/delete/88629/useless
Del: bad code -- https://master.php.net/note/delete/88629/bad+code
Del: spam -- https://master.php.net/note/delete/88629/spam
Del: non-english -- https://master.php.net/note/delete/88629/non-english
Del: in docs -- https://master.php.net/note/delete/88629/in+docs
Del: other reasons-- https://master.php.net/note/delete/88629
Reject -- https://master.php.net/note/reject/88629
Search -- https://master.php.net/manage/user-notes.php