Problem loading keystore file into java keystore object
843811Nov 25 2002 — edited Nov 26 2002Hello all,
I have a problem loading "pkcs12" format keystore into the Keystore object, following is the code
---code------
InputStream is = new FileInputStream("c:/keystore/my_keystore");
KeyStore ks = KeyStore.getInstance("PKCS12");
System.out.println("KeyStore instance created.....");
ks.load(is,"password".toCharArray());
System.out.println("KeyStore loaded.....");
is.close();
--------------------------------
At runtime i am getting the following Exception
-----Error----------------------
KeyStore instance created.....
java.io.IOException: toDerInputStream rejects tag type 2
Exception in thread "main" java.lang.NullPointerException
--------------------------------
I have no clue on why this exception is thrown even after the keystore name, keystore file path and keystore passward being correct.
Any help in this regard will be appreciated.
I am running out of time, somebody please send me a reply on this topic as early as possible
Thanks in advance
Raju Ponnam