Get public key from a certificate

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Get public key from a certificate

Angel Martinez Gonzalez
Hello:

I have a certificate in char * format, and I want to get his public key.

Are there an OpenSSL function to do this?.

Thanks.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Get public key from a certificate

Goetz Babin-Ebell
Angel Martinez Gonzalez wrote:
> Hello:
>
> I have a certificate in char * format, and I want to get his public key.
>
> Are there an OpenSSL function to do this?.

Define char * format.

If you have a char * pointing to a certificate in PEM format,
you can do a BIO_new_mem_buf() and create a BIO.
>From there you can do a  PEM_read_bio_X509() to get the certificate.

If the certificate is in binary, you can do a d2i_X509() to get the
certificate.

Bye

Boetz

--
DMCA: The greed of the few outweighs the freedom of the many

smime.p7s (4K) Download Attachment