Date: Mon, 01 Feb 1999 12:04:57 -0500
From: "Ralph G. Puga" <puga@tis.com>
To: Java Security <java-security@java.sun.com>
Subject: JCE Keystore Bug ???
This is a multi-part message in MIME format.
--------------6BA91D13A3D7018466BD2F3C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I wanted to report a possible bug with the rc1 version of the JCE. I am
writing Java code that creates and stores secret keys into a privately
implemented keystore. I initially create the key using JCEKS and the
SunJCE provider. I then generate a 3Des key using the KeyGenerator
class. Next, I use setKeyEntry to store the Secret key into my
keystore, however I don't provide any certificates for the key since I
don't need them for my application.
The problem: When I attempt to retrieve the key from the keystore using
getKey, I receive an error which appears to me as an ASN.1 error. This
doesn't make sense to me since there are no certs used to create the key
and the documentation states that certs are unessessary if you are not
using private keys. I have included the error message below.
Thanks for your attention,
--Ralph P.
-- Ralph G. Puga puga@tis.com TIS Labs at Network Associates Inc. (443) 259-2323 (Voice) 3060 Washington Rd. (RT.97) (800) 918-0622 (Beeper) Glenwood, MD 21738 (443) 259-2300 (Main) (301) 854-4731 (FAX)
--------------6BA91D13A3D7018466BD2F3C Content-Type: text/plain; charset=us-ascii; name="foo" Content-Disposition: inline; filename="foo" Content-Transfer-Encoding: 7bit
My provider name is SunJCE My provider version # is 1.2 Keystore is 216 bytes This is a keystore of type -> JCEKS These are the keystore aliases -> keytwo These are the keystore aliases -> keyone KeyOne is a valid key Exception in thread "main" java.security.UnrecoverableKeyException: DerInput.getLength(): lengthTag=34, too big. at com.sun.crypto.provider.KeyProtector.recover(Compiled Code) at com.sun.crypto.provider.JceKeyStore.engineGetKey(Compiled Code) at java.security.KeyStore.getKey(Compiled Code) at CreateKeyStore.main(Compiled Code)
--------------6BA91D13A3D7018466BD2F3C--