Help using openssl with PHP 5.1.6 (can't extract public key)
Posted: Wed Nov 17, 2010 7:36 pm
Hi,
Hope someone can help me as I'm banging my head against a brick wall with this
Does anyone have an example of how to generate a public/private key pair using openssl that works with PHP version 5.1.6 please? My main problem at the moment is that most of the examples I've seen require openssl_pkey_get_details (which doesn't work with this version) and all the other things I've tried give me errors such as
"supplied resource is not a valid OpenSSL X.509/key resource"
or
"Don't know how to get public key from this private key"
Getting the private key and/or certificate is easy enough, but it all seems to fall down when I try to get the public key.
I've tried some of the examples on the main PHP site but none seem to work and upgrading the version of PHP I'm using isn't an option. What I think I'll probably end up doing is just generating the keys on my local PHP install but I find it difficult to believe that openssl is this difficult to get working under 5.1.6 - I've wasted probably three hours on this already
Thanks in advance,
Mecha Godzilla
Hope someone can help me as I'm banging my head against a brick wall with this
Does anyone have an example of how to generate a public/private key pair using openssl that works with PHP version 5.1.6 please? My main problem at the moment is that most of the examples I've seen require openssl_pkey_get_details (which doesn't work with this version) and all the other things I've tried give me errors such as
"supplied resource is not a valid OpenSSL X.509/key resource"
or
"Don't know how to get public key from this private key"
Getting the private key and/or certificate is easy enough, but it all seems to fall down when I try to get the public key.
I've tried some of the examples on the main PHP site but none seem to work and upgrading the version of PHP I'm using isn't an option. What I think I'll probably end up doing is just generating the keys on my local PHP install but I find it difficult to believe that openssl is this difficult to get working under 5.1.6 - I've wasted probably three hours on this already
Thanks in advance,
Mecha Godzilla