Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Keytool: Invalid keystore format

843811Jan 29 2006 — edited Jun 15 2007
java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:632)
        at java.security.KeyStore.load(KeyStore.java:1150)
Hi all,

My app used to work perfectly connecting via ssl, using certificates. Recently, I updated my computer to jdk1.5.0_06. I then decided to create a new pair of certificates to replace the old ones. And here is where the problems lie. For some reason, java does not like the format!

Here is what I did using keytool:
>keytool -genkey -keystore serverks -keyalg rsa -keysize 2048 -alias server -storepass password -keypass keypasswd
What is your first and last name?
  [Server]:
What is the name of your organizational unit?
  [Software Development]:
What is the name of your organization?
  [www.mysite.com]:  www.mysite.com
What is the name of your City or Locality?
  [Arizona]:
What is the name of your State or Province?
  [CA]:
What is the two-letter country code for this unit?
  [AU]:
Is CN=Server, OU=EbayHelper, O=www.mysite.com, L=Arizona, ST=CA, C=AU correct?
  [no]:  y


keytool -export -alias server -file servercert -keystore serverks
Enter keystore password: password Certificate stored in file <servercert>
In java, where the program hangs is here:
KeyStore keystore = KeyStore.getInstance("JKS");
keystore.load(new FileInputStream(KEYSTORE), KEYSTOREPW)
It hangs on keystore.load. Anyone know what has happened? What did I miss? Has anything changed since jdk1.4.08?? I've been trying to research with not much luck.

Any assistance is appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2007
Added on Jan 29 2006
18 comments
45,861 views