Starting Jar using RMI and SSL

Hello friends,

I developed a client server based program using RMI and SSL. It works fine. But I don't want to start the jar files each time with the following command:

java -Djavax.net.ssl.trustStore=server.keystore -Djavax.net.ssl.keyStore=server.keystore -Djavax.net.ssl.keyStorePassword=xy -jar server.jar

Therefore I was thinking about putting the keys inside of the server.jar and loading it from one of my classes. The code which I have implemented to load the keys from jar looks like follows:

URL trustStore = ClassLoader.getSystemResource("server.keystore");

System.setProperty("Djavax.net.ssl.trustStore", trustStore.toExternalForm());

URL keystore = ClassLoader.getSystemResource("server.keystore");

System.setProperty("Djavax.net.ssl.keyStore", keystore.toExternalForm());

System.setProperty("Djavax.net.ssl.keyStorePassword", "xy");

I already have done this with my policy file, but in case of the keys it seems it doesn't work. Have somebody got an idea?

Greetings

daniel

[1075 byte] By [master_bruin_the_beara] at [2007-10-3 4:17:03]
# 1
OK, I'm solved it by myselfe.
master_bruin_the_beara at 2007-7-14 22:18:37 > top of Java-index,Desktop,Deploying...
# 2
How do you sovle this problem ?I use the String keystorePath =ClassLoader.getSystemResource("resources/certification/Server_Keystore").getPath()System.setProperty("javax.net.ssl.keyStore", keystorePath);but it can not find the file ?
Edwarddua at 2007-7-14 22:18:37 > top of Java-index,Desktop,Deploying...