[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iaik-jce] PrivateKey Interpretation problem

Hi David

Thanks a lot. You are correct. SSLeay stores private keys in PKSC1 format.
It skipped my mind. But I still wonder why it gave an error on
interpreting the publickey Info structure. That is when I thought it might
have to do something with the ASN1 structuring.



On Fri, 11 Jun 1999, David Taylor wrote:

> >I am trying to read the RSAPrivateKey generated by Eric Young's SSLeay
> >library from IAIK_JCE and it gives me the following error:
> >"Unable to decode private key: java.security.InvalidKeyException: Can't
> >parse PublicKeyInfo."
> SSLeay saves private keys in a DER encoded PKCS-1 RSAPrivateKey structure,
> not a DER encoded PKCS-8 PrivateKeyInfo structure. If the private key is
> encrypted it is done so according to PEM rules, not PKCS-8 rules.
> To create a Java private key from an SSLeay saved private key, you must
> decrypt the key data (if necessary), parse the DER encoding to get the 8
> INTEGER values and use them to create an RSAPrivateCrtKeySpec. Then pass
> that into an RSA key factory with generatePrivate().
> A question: why is IAIK trying to parse a PublicKeyInfo structure if you're
> trying to decode a private key?
> Regards,
> David Taylor
> FORGE Research.

Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html

To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce