FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » OpenSSL, openssl_pkey_get_private
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
OpenSSL, openssl_pkey_get_private [message #175257] Tue, 30 August 2011 08:26 Go to previous message
jwcarlton is currently offline  jwcarlton
Messages: 76
Registered: December 2010
Karma:
Member
This is a new one for me, so bear with me.

I'm following a tutorial for encrypting data. I used the following to
generate a public and private key on a Linux Redhat 4 system:

openssl genrsa -des3 -out private_key.pem 2056
openssl rsa -pubout -in private_key.pem -out public_key.pem

Now, I need to get those keys, and I'm using:

$public_key = openssl_pkey_get_public('file://public_key.pem');
$private_key = openssl_pkey_get_private('file://private_key.pem', '[my
password]');

I'm returning false, though, and I'm guessing that it's because of the
"file://" (which looks like what you'd use on a Windows server)? I
tried file:///, though, and it had no impact.

I've tried every variation I could think of, but I'm still getting
nothing.

I DO have OpenSSL turned on when I compiled Apache (I triple-checked).
I'm not seeing any references to it in php.ini, but I do have the
following disabled:

show_source, system, shell_exec, passthru, exec, phpinfo, popen,
proc_open, allow_url_fopen, ini_set

Would any of those affect it?

If not, can you guys suggest how I should be retrieving the key
correctly?

TIA,

Jason
[Message index]
 
Read Message
Read Message
Previous Topic: fopen error
Next Topic: Deploying PHP 5.3 on CentOS 5.6 with Puppet
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 20:25:21 GMT 2024

Total time taken to generate the page: 0.04217 seconds