Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

KeyStore.load() throws NullPointerException

447 views
Skip to first unread message

Andrew Miskelly

unread,
Jan 18, 2004, 8:00:25 PM1/18/04
to
Hi,

Could someone please let me know the circumstances under which
java.security.KeyStore.load(InputStream, char[]) throws a
NullPoiterException, as follows:

KeyStore keyStore = KeyStore.getInstance("IAIKKeyStore", "IAIK");
if (keyStore != null)
keyStore.load(keyStoreFile, keyStorePassword);

java.lang.NullPointerException
at iaik.security.keystore.IAIKKeyStore.a(Unknown Source)
at iaik.security.keystore.IAIKKeyStore.engineLoad(Unknown Source)
at java.security.KeyStore.load(KeyStore.java:652)
...

I have limited experience with Java security but I'm trying to shift a
webapp that uses the above code from an old machine with Tomcat and
JDK1.3.1 to a new machine with Tomcat 4 and JDK1.4.2 (have tried 1.4.1
as well).

Any help would be greatly appreciated.

Regards,
Andrew.

Karl Scheibelhofer

unread,
Jan 19, 2004, 8:33:51 AM1/19/04
to
did you ensure that you use a signed version of the provider jar file (e.g.
iaik_jce.jar)? the JCE included in JDK 1.4 and above requires signed
provider jar files while older versions did not care at all. moreover, you
should ensure that the unlimited strength jurisdiction policy files are
installed.

Karl


"Andrew Miskelly" <amis...@theweather.com.au> wrote in message
news:b34e23f5.04011...@posting.google.com...

Roedy Green

unread,
Jan 19, 2004, 5:10:08 PM1/19/04
to
On 18 Jan 2004 17:00:25 -0800, amis...@theweather.com.au (Andrew
Miskelly) wrote or quoted :

>keyStore.load(keyStoreFile, keyStorePassword);

do a check the neither keyStoreFile (nor keyStorePassword) are null.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Karl Scheibelhofer

unread,
Jan 20, 2004, 2:19:51 AM1/20/04
to
both arguments may be null. this should not cause a problem.

Karl

"Roedy Green" <look-at-t...@mindprod.com> wrote in message
news:oclo009e5kli3q056...@4ax.com...

Andrew Miskelly

unread,
Jan 22, 2004, 6:17:14 PM1/22/04
to
Looks like that's the problem, Karl. The JAR is unsigned.

BTW, the code does actually check that keyStoreFile is not null and
for what it's worth the password is also not null.

Thanks for your responses.

Regards,
Andrew.

Kris Topher

unread,
Mar 11, 2004, 12:18:30 PM3/11/04
to
Hi

I am having a similiar problem in migrating an app, which uses the free Togeher SMIME Library, from WebLogin 6.1 (JDK 1.3.1) to WebLogic 8.1 (JDK 1.4.1).

I just wondered how to make the jar file signed. Or is there any other free library available that works under JKD 1.4.1?

Thanks,
Kris

0 new messages