Here's one way to do it:

BIO *mbio = BIO_new(BIO_s_mem());
PEM_write_bio_X509(mbio, cert);
len = BIO_read(mbio, temp_text, MAX_SIZE);
if (len>0) temp_text[len]=0;
BIO_free(mbio);


-----Original Message-----
From: openssl-dev [mailto:openssl-dev-boun...@openssl.org] On Behalf Of dE
Sent: Sunday, March 15, 2015 6:46
To: openssl-dev@openssl.org
Subject: [openssl-dev] Write PEM to char*

Hi!

I was wondering if there are ways by which you can get a PEM encoded 
certificate stored into a char* from a X509 structure.

I got a lot of ways to write it to FILE, but nothing appears to return a char*.

Thanks for any pointers.
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

________________________________

This email and any files transmitted with it are confidential material. They 
are intended solely for the use of the designated individual or entity to whom 
they are addressed. If the reader of this message is not the intended 
recipient, you are hereby notified that any dissemination, use, distribution or 
copying of this communication is strictly prohibited and may be unlawful.

If you have received this email in error please immediately notify the sender 
and delete or destroy any copy of this message
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev

Reply via email to