Laurent,

    You cannot use a memory BIO that way; BIO_new_mem_buf() creates a
READ-ONLY BIO. See (http://www.openssl.org/docs/crypto/BIO_s_mem.html#).
Instead, just do bp = BIO_new(BIO_s_mem()) and go from there

_____________________________________
Greg Stark
Ethentica, Inc.
[EMAIL PROTECTED]
_____________________________________



----- Original Message -----
From: "Hausermann Laurent" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 25, 2001 9:37 AM
Subject: Pb using memory bio


> Hi all,
>
> I still have some trouble with the memory BIO.
> I want to write a PEM struct into a memory BIO
> So I do :
>
> BIO * bp;
> d=malloc(1024);
> bp=BIO_new_mem_buf(d,1024);
> ret = PEM_write_bio_X509(bp,x509);
>
> And it fails !
>
> But if i do :
>
> BIO *out;
> BIO *out=OpenSSLCore.BIO_new(OpenSSLCore.BIO_s_file());
> BIO_set_fp(out,stdout,BIO_NOCLOSE);
> ret =  PEM_write_bio_X509(out, x509) // x509 is a X509 *
>
> it works and print down the PEM certificate.
>
> Any Idea ?
> I didn't found example on Memory BIO ...
>
> Thanks
>
> Laurent
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to