Howard Chu wrote:
>
> Yes, it's quite easy. This works for me in 0.9.4:
> (char *buf; int len; values should already be set)
> ...
> BIO *bi = BIO_new(BIO_s_mem());
> BUF_MEM bf;
> X509 *x;
> bf.length = len;
> bf.data = buf;
> bf.max = bf.length;
> BIO_set_mem_buf(bi, &bf, 0);
> x = PEM_read_bio_X509(bi, NULL, NULL, NULL);
>
Yes that will work. However you should also do
BIO_set_close(bi, BIO_NOCLOSE);
otherwise it will try to Free() the buffer when you do BIO_free(bi);
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]