Richard Levitte - VMS Whacker wrote:
> 
> It's possible that this question has already been answered, but...
> 
> I need to get my certificate (PEM format) into my Navigator's cert
> database.  The only suitable format according to Navigator (4.61,
> BTW...) is PKCS12 (.p12 files).
> 
> Now, to convert from one to the other has gone beyond me.  Perhaps I'm
> just too tired to see, I dunno.  Help, anyone?


I know whats confusing you here: the PKCS#12 stuff is all documented :-)

You can't just convert a certificate you need a certificate and
corresponding private key (and option other certificates).

Here's an outline:

Read the user certificate into an X509 structure.

Read the private key into an EVP_PKEY structure. 

Any extra certificates (optional) can be put into a STACK_OF(X509)
structure.

Call PKCS12_create() with the password and an appropriate name and
you'll get back a PKCS12 structure properly encoded. 

Write to wherever using i2d_PKCS12_bio() or i2d_PKCS12_fp()

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