Almost forgot. Here is the private key I am trying in der format.  
Please disregard the fact that the file has a .cer extension.

-Jim

-------- Original Message --------
Subject: Problem w/ d2i_RSAPrivateKey
Date: Mon, 13 Sep 1999 17:14:25 -0400
From: Jim Miller <[EMAIL PROTECTED]>
Organization: Entegrity Solutions
To: [EMAIL PROTECTED]

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 :

RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
 {
 int i=ASN1_R_PARSING;
 ASN1_INTEGER *bs=NULL;
 M_ASN1_D2I_vars(a,RSA *,RSA_new);

 M_ASN1_D2I_Init();
 M_ASN1_D2I_start_sequence();
 M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER);
 if (bs->length == 0)
  ret->version=0;
 else ret->version=bs->data[0];
 M_ASN1_D2I_get(bs,d2i_ASN1_INTEGER);  // dying here

Reply via email to