Try:

FILE* fpKey;
(open DER key file)
EVP_PKEY* pKey = d2i_PrivateKey_fp(fpKey, NULL);

FILE* fpKey2;
(open new PEM key file)
PEM_write_PrivateKey(fpKey2, pKey, NULL, NULL, 0, NULL, NULL);

Kim Hellan

> -----Oprindelig meddelelse-----
> Fra:  Andrew Griffin [SMTP:[EMAIL PROTECTED]]
> Sendt:        27. april 2000 16:41
> Til:  [EMAIL PROTECTED]
> Emne: Converting DER format private key to PEM
> 
> Dear all,
> 
> I am trying to load a private key in DER format using
> RSA_usePrivateKeyFile without success.
> Is there a utility or segment of code somewhere that I can use to
> convert the DER format to PEM format as that seems to work fine.
> 
> I'm using OpenSSL 0.9.5 on Digital Tru64 Unix
> 
> many thanks
> 
> Andy Griffin <<Fil: Card for Andrew Griffin>> 
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to