Hi Christian,

thanks a lot for your response!

FILE *fpkcs7 = fopen("C:\\sig.p7s", "wb+");

solved my problem!

Thanks a lot!!!

Christian

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Christian Hohnstaedt
Gesendet: Donnerstag, 16. August 2007 16:18
An: openssl-users@openssl.org
Betreff: Re: problem using pkcs7 DER encoding

On Thu, Aug 16, 2007 at 03:58:19PM +0200, Christian Wiesbauer wrote:
> Hi, 
> 
>  
> 
> I'm trying to write a pkcs7 object with following code to a file:
> 
>  
> 
> unsigned char *tmp, signature;
 
 unsigned char *tmp, *signature;

> 
> int iLen;
> 
>  
> 
> iLen = i2d_PKCS7(p7, NULL);
> 
> signature = (unsigned char*) malloc(iLen);
> 
> tmp = signature;
> 
> iLen = i2d_PKCS7(p7, &tmp);
> 
>  
> 
> FILE *fpkcs7 = fopen("C:\\sig.p7s", "w+");

FILE *fpkcs7 = fopen("C:\\sig.p7s", "wb+");

> 
> for(int i = 0; i < iLen; i++)
> 
>    fprintf(fpkcs7, "%c", signature[i]);
> 
> fclose(fpkcs7);
> 

Maybe that helps

Christian

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

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

Reply via email to