Getting public key using openssl_*

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Has anyone been sucessful in getting/reading a RSA or DSA public key
using the openssl functions?

openssl_get_publickey should work with PEM files, but it doesn't...

I've tried creating a X.509 certificate, putting the public key in
there and getting it out with openssl_get_publickey, but it doesn't
work either...

All I want to do is to decrypt some data using a public key received
from the user. Ideas?

Re: Getting public key using openssl_*

Quoted text here. Click to load it

Actually it does, if you give it the key in the right format. Something

  -----BEGIN PUBLIC KEY-----
  -----END PUBLIC KEY-----

I managed to create the public key from the private key using the
openssl command line tool:

  $ openssl rsa -in private_key -pubout -out public_key

Site Timeline