In article <00ca01be9b01$7c16e3a0$[EMAIL PROTECTED]> you wrote:

> Hi, how can I convert a certificate from X509*xs structure format to DER =
> format, and put it in a char * string in C, without using a temporary file ?
> Thanks everibody in advance.

First, can you please post in plain ASCII? It's nasty to see your doubled
postings and some of them even in HTML format. Thanks.

Second, your question: You can do this with i2d_X509.  
In mod_ssl I use something like this:

   asn1->nData  = i2d_X509(pX509Cert, NULL);
   asn1->cpData = ap_palloc(mc->pPool, asn1->nData);
   ucp = asn1->cpData; i2d_X509(pX509Cert, &ucp); /* 2nd arg increments */

For more details look at mod_ssl's ssl_engine_pphrase.c around lines 152.

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to