Jim Miller wrote:
> 
> I am working on adapting our PKI toolkit to use OpenSSL.  We of course
> have our own internal format for storing private keys.  My problem is
> this, I export our private key in a ASN.1 DER encoded format and then
> try to "import" it with d2i_RSAPrivateKey().  No luck, the function is
> failing and returning a NULL.  It is specifically dying within :
> 
[example deleted]

Hmmm... what format are you using for private keys? OpenSSL can handle
several different formats.

d2i_RSAPrivateKey() is for use with PKCS#1 format. You may be using a
PKCS#8 PrivateKeyInfo structure which means you can use
d2i_PKCS8_PRIV_KEY_INFO(), the value returned can be converted into an
EVP_PKEY structure with EVP_PKCS82PKEY(). 

Other functions can handle encrypted PKCS#8 formats.

Check out the pkcs8 application in apps/pkcs8.c for more info.

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

Reply via email to