Erwann ABALEA wrote:
> 
> Could I suggest to add this in the default .h files?:
> 
> #define d2i_PrivateKey_bio(bp,x) (EVP_PKEY *)ASN1_d2i_bio(\
>         (char *(*)())EVP_PKEY_new, (char *(*)())d2i_PrivateKey, bp, \
>         (unsigned char **)x)
> 
> I wanted to be able to save my private keys in DER format, and read them
> later... I didn't find the macro/function to do it... Unfortunately, my
> definition doesn't handle encrypted keys...
> 

One minor problem... d2i_PrivateKey doesn't exist!

DER encoded private keys are a bit of a problem because you can't
automatically tell the format (unlike PEM keys where you can read the
header lines). This means you have to know the format in advance so
you'd need separate versions for RSA, DSA, PKCS#8 unencrypted and PKCS#8
encryped.

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