Hi there!!
 
I'm trying to use the high level function PKCS12_create in my app to get a p12 file to import it in MSIE and MS Outlook but it seems to be nothing, I mean, I get an empty p12 file.
 
I followed the pkwrite example in \demos\pkcs12 but it doesn't works..
 
follow mi code:
 
out = BIO_new_file(outfile, "wb");
 if (out==NULL)
 {
  //Error
 }
 fp = fopen("Prueba1.p12", "wb");
 if ( fp == NULL)
 {
 //Error
 }
// load the privkey, the certificate and the password for the p12 file
 
p12 = PKCS12_create (pass, outfile, key, ucert, NULL, 0,0,0,0,0); // No problem
 
res = i2d_PKCS12_fp(fp, p12); //this crashes myprogram
fprintf(stderr, "fp res=%d\n", res);
 
res = i2d_PKCS12_bio(out, p12); // No problem
fprintf(stderr, "res=%d\n", res); // res =1
 
if (BIO_write_filename(out, outfile) <= 0)
{
  fprintf(stdout,"Error generando file p12 \n");
}

I need some help please ....
 
TIA
 
Zainos



Do You Yahoo!?
Yahoo! Net: La mejor conexión a internet y 25MB extra a tu correo por $100 al mes.

Reply via email to