The Java keystore


Background


A keystore:

   Building the keystore - the command line:
      ~/SSHexample > keytool -genkey -keystore mySrvKeystore -keyalg RSA


Building the keystore - the dialog:

java-keytool-commands

On hoare.cs.umsl.edu

the dialog

On my Windows PC

windows 8

(throws various exceptions)


Using the keystore:

 In the directory containing Echoserver

    java -Djavax.net.ssl.keyStore=mySrvKeystore -Djavax.net.ssl.keyStorePassword=123456 EchoServer

 Copy the certificate file into the EchoClient working directory:

   java -Djavax.net.ssl.trustStore=mySrvKeystore -Djavax.net.ssl.trustStorePassword=123456 EchoClient

 If you want SSL debug information just add these parameters when running server and/or client:

   -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.debug=ssl

The Code (EchoServer output is slightly different)