example to use keytool to set up public/private keys

  1. Run the following two commands to generate keystore
    keytool –genkeypair –alias dlkey -keypass password -storetype jks –keystore dlkeystore.jks -storepass password -validity 365 -keyalg RSA
  2. Export certificate of private key dlkey
    keytool –exportcert –alias dlkey -file dlkey.cert -keystore dlkeystore.jks -storepass password
  3. Send the dlkey.cert (public key) to target server.
  4. Run the following command to import the server certificate (fnet.net.cer) to keystore

keytool –importcert –file fnet.net.cer -alias dlcert -keypass password -keystore dlkeystore.jks –storepass password

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s