# Re: Problem with the keytool (JDK 1.2 Beta 4)

Jan Luehe (luehe@laguna.eng.sun.com)
Mon, 3 Aug 1998 11:53:55 -0700 (PDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Seng Un Leong: "signed applet mot work"
- Previous message: Ramin Hariri: "Security interest mailing list"
- Maybe in reply to: Thorsten Goeller: "Problem with the keytool (JDK 1.2 Beta 4)"

    Date: Mon, 3 Aug 1998 11:53:55 -0700 (PDT)

    From: Jan Luehe <luehe@laguna.eng.sun.com>

    Subject: Re: Problem with the keytool (JDK 1.2 Beta 4)

    To: java-security@java.Sun.COM, tgoeller@metafinanz.de

Thorsten:

> But when I want to list the keys with keytool -list, there is an exception:
> keytool -list
> keytool error: java.io.IOException: corrupt subject key

This is due to the fact that the public key is stored as an
ASN.1 encoded X.509 certificate in your keystore.

When parsing the certificate data, we look at the algorithm
identifier of the public key to figure out what kind of
(Public)KeyFactory to instantiate. Since you overwrote the
getEncoded method of your key classes to not return ASN.1
encoded data, the encoding of the certificate that was stored
cannot be parsed, causing the above exception to be raised.

Jan

- Next message: Seng Un Leong: "signed applet mot work"
- Previous message: Ramin Hariri: "Security interest mailing list"
- Maybe in reply to: Thorsten Goeller: "Problem with the keytool (JDK 1.2 Beta 4)"