On Sun, Mar 15, 2015 at 10:16:25AM +0530, dE wrote: > 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*.
Use a memory BIO and PEM_write_bio_X509(). In memory the DER representation is generally more useful than PEM. The only plausible reason that comes to mind for using PEM in memory is for a UI that allows users to copy/paste PEM format certificates. Do you really need PEM? Or might i2d_X509() be a better interface for your real needs (serializing X509 data). -- Viktor. _______________________________________________ openssl-dev mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev