Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / March 2004

Tip: Looking for answers? Try searching our database.

KeyStore.load() throws NullPointerException

Thread view: 
Andrew Miskelly - 19 Jan 2004 01:00 GMT
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 - 19 Jan 2004 13:33 GMT
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

> Hi,
>
[quoted text clipped - 21 lines]
> Regards,
> Andrew.
Roedy Green - 19 Jan 2004 22:10 GMT
>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 - 20 Jan 2004 07:19 GMT
both arguments may be null. this should not cause a problem.

 Karl

> >keyStore.load(keyStoreFile, keyStorePassword);
>
[quoted text clipped - 4 lines]
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Andrew Miskelly - 22 Jan 2004 23:17 GMT
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 - 11 Mar 2004 17:18 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.