Java Tool Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 5.10

'keytool' - Public Key Certificate Tool

This chapter provides notes and tutorials on the public key certificate management tool, 'keytool'. Topics include introduction of certificates and 'keystore' files, list of 'keytool' commands, generating private and public key pair, importing and exporting certificates.

Certificates and Certificate Chains

'keystore' - Public Key Certificate Storage File

JDK 1.5 'keytool' - keystore File Management Commands

JDK 1.6 'keytool' - keystore File Management Commands

Generating Key Pairs and Self-Signed Certificates

Exporting and Import Certificates

Cloning Certificates with New Identities

Conclusion:

  • A key entry in keystore contains a private key and a certificate of the public key.
  • Certificates can be exported into certificate files out of keystore.
  • Certificates can be imported from certificate back into keystore.
  • There seems be to no way to export private keys.
  • There seems be to no way to generate a certificate of a given public key - signing a public key.

Dr. Herong Yang, updated in 2008
'keytool' - Public Key Certificate Tool