Title: ??: How to load a P12 certificate?
 
i think u should initialize the openssl lib first..
-----原始邮件-----
发件人: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]代表 Jordan C N Chong
发送时间: 2001年9月17日 21:04
收件人: [EMAIL PROTECTED]
主题: RE: How to load a P12 certificate?

Dear YongYue
 
I am sorry to bother you again. Thousand thanks for your help indeed. After testing your code, sadly it doesn't work. I have done two tests on the codes:
 
1. Put nothing (or some wrong password) at the password field during parsing
2. Test whether the m_pcert and m_pkey are NULL
 
the first one doesn't do anything at all to the codes.
the second one, well I am not sure, m_pkey is NULL.
 
I do need your help. Thousand thanks.
 
All the best.
 

Best regards,
--------------------------------------------
Jordan Cheun Ngen, Chong
INF-4067 Universiteit Twente
Postbus 217
7500 AE Enschede
The Netherlands

Distributed and Embedded Systems (DIES)
--------------------------------------------
Office Phone: +31 53 4894655
Web site: http://www.cs.utwente.nl/~chong
Email Add.: [EMAIL PROTECTED]
============================================

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of YONG.YUE
Sent: Thursday, September 13, 2001 10:54 AM
To: '[EMAIL PROTECTED]'
Subject: ??: How to load a P12 certificate?

just refer to  this code

        // new bio mem area
        m_biopkcs12 = BIO_new_file(szpkcsfile, "rb");
        if(m_biopkcs12 == NULL)
        {
                bError = false;
                goto finish;
        }
        // parse pkcs12
        m_pkcs12 = d2i_PKCS12_bio(m_biopkcs12, NULL);
        if(m_pkcs12 == NULL)
        {
                bError = false;
                goto finish;
        }
        //
        nLen = PKCS12_parse(m_pkcs12, szpkcspasswd, &m_pkey, &m_pcert, NULL);
        if(nLen < 0)
        {
                bError = false;
                goto finish;
        }
        //
        BIO_free_all(m_biopkcs12);
        return true;


> Look at PKCS12_Parse().  You provide it a buffer with the
> PKCS#12 and the password for the private key, and it
> returns an X509 object and a EVP_PKEY object.

Could you please tell me, which document should I look to regards this?
Thanks again for your help. Wish you all the best.

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

Reply via email to