hazel_gao wrote:
>
> I want to load a X509 cert from a pem format buffer. I know there are
> PEM_read_X509 and PEM_read_bio_X509. But they are for files. Saving the
> buffer to a file, then open it to load X509 sounds somewhat stupid. Can
> anyone tell me an API to load X509 from a char* buffer?
>
They aren't for files they are for fps and BIOs which aren't necessarily
files. BIOs in particular can point to all manner of things including a
memory buffer. For example in OpenSSL 0.9.5 and later you can call:
bio = BIO_new_mem_buf(buffer, length);
and then call PEM_read_bio_X509() on it.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]