[EMAIL PROTECTED] wrote:
> 
> Hi,
> I'm having trouble parsing a pkcs12 file in a program.  The p12 file
> parses fine with the command line program, so I assume I'm not using the
> api correctly.  I'm using the latest release of openssl on a linux box.
> Here is the series of calls I'm trying in my test program:
> 
>     PKCS12* p12_p = d2i_PKCS12_fp(fp, NULL); // fp is a FILE* that
> points at the p12 file
>     if (!p12_p)
>     {
>         cerr << "error reading the p12 file" << endl;
>         exit(-1);
>     }
>     EVP_PKEY* privKey_p = NULL;
>     X509* cert_p;
>     char* pass = "foobar";
>     if (PKCS12_parse(p12_p, pass, &privKey_p, &cert_p, NULL) == 0)
>     {
>         cerr << "error parsing the p12 file" << endl;
>         char* err_buf = ERR_error_string(ERR_get_error(), NULL);
>         cerr << err_buf << endl;
>         exit(-1);
>     }
> 
> this is the error i receive:
> error:2306B076:PKCS12 routines:PKCS12_gen_mac:unknown digest algorithm
> 
> Any suggestions on the correct way to extract the cert. and private key
> from a p12 file would be greatly appreciated.
> thanks,

http://www.openssl.org/support/faq.html#12

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
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to