Thanks a lot.
Giacob

-----Messaggio originale-----
Da: Dr Stephen Henson <[EMAIL PROTECTED]>
A: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Data: marted� 11 maggio 1999 19.43
Oggetto: Re:


>> Andrea e Luca Giacobazzi 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.
>>
>
>You can use a memory BIO but the easiest way is to directly use the ASN1
>functions.
>
>Something like this will do it:
>
>unsigned char *buf, *p;
>int len;
>
>len = i2d_X509(xs, NULL);
>buf = Malloc(len);
>p = buf;
>i2d_X509(xs, &p);
>
>... DER encoded cert in 'buf' ...
>
>You need the temporary pointer 'p' because the ASN1 functions
>automatically increment the passed pointer.
>
>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]
>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]
  • R: Andrea e Luca Giacobazzi
    • Andrea e Luca Giacobazzi

Reply via email to