Generate a key entry into a keystore
Generating key entry into keystore: C:\tmp\ssl>keytool -genkey -alias remoting -keyalg RSA Enter keystore password: opensource What is your first and last name? [Unknown]: Tom Elrod What is the name of your organizational unit? [Unknown]: Development What is the name of your organization? [Unknown]: JBoss Inc What is the name of your City or Locality? [Unknown]: Atlanta What is the name of your State or Province? [Unknown]: GA What is the two-letter country code for this unit? [Unknown]: US Is CN=Tom Elrod, OU=Development, O=JBoss Inc, L=Atlanta, ST=GA, C=US correct? [no]: yes Enter key password for (RETURN if same as keystore password): Since did not specify the -keystore filename parameter, created the keystore in $HOME/.keystore (or C:\Documents and Settings\Tom\.keystore). Export the RSA certificate (without the private key) C:\tmp\ssl>keytool -export -alias remoting -file remoting.cer Enter keystore password: opensource Certificate stored in file Import the RSE certificate into a new truststore file. C:\tmp\ssl>keytool -import -alias remoting -keystore .truststore -file remoting.cer Enter keystore password: opensource Owner: CN=Tom Elrod, OU=Development, O=JBoss Inc, L=Atlanta, ST=GA, C=US Issuer: CN=Tom Elrod, OU=Development, O=JBoss Inc, L=Atlanta, ST=GA, C=US Serial number: 426f1ee3 Valid from: Wed Apr 27 01:10:59 EDT 2005 until: Tue Jul 26 01:10:59 EDT 2005 Certificate fingerprints: MD5: CF:D0:A8:7D:20:49:30:67:44:03:98:5F:8E:01:4A:6A SHA1: C6:76:3B:6C:79:3B:8D:FD:FB:4F:33:3B:25:C9:01:9D:50:BF:9F:8A Trust this certificate? [no]: yes Certificate was added to keystore Now have two files, .keystore for the server and .truststore for the client.