OpenSSL, openssl_pkey_get_private [message #175257] |
Tue, 30 August 2011 08:26 |
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
|
|
|