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!

keystore with no password

843811Nov 22 2001 — edited Dec 18 2001
I need to write a ssl application which gets authenticated with a server and sends a request to the server. A keystore was given by the server application developers.

The keystore has no password. So when loading the keystore i gave password as null. But when initializing the KeyManagerFactory , it is not accepting null.

I tried the foll. code

SSLContext ctx=SSLContext.getInstace("TLS","SunJSSE");
KeyManagerFactory kmf=KeyManagerFactory.getInstance("SunX509");
Keystore ks=KeyStore.getInstance("JKS");

ks.load(new FileInputStream("keystorefile",null);
kmf.init(ks,null);
ctx.init(kmf,null,null);
.....
....

I am getting an exception when i use null in KeyManagerFactory initialization.

Any body knows what should i do?

Is there any way to set some password to the keystore.


Thanks.

venkat
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2002
Added on Nov 22 2001
2 comments
2,003 views