1. JDK 1.4 and 1.5
Use keytool -genkey to generate一对密钥
2. JDK 1.6
-export renamed to -exportcert
-genkey renamed to -genkeypair
But at the same time, it is forward compatible and supports the original command parameters.
2.1 usage of keytool
Note: The new one here is -genseckey is to generate a symmetric key, which is different from the old key pair command genkey
2.2 Create a certificate
To create a certificate is mainly to use "-genkeypair", the available parameters of this command are as follows:
For more see ssl certification, certificate]SSL two-way authentication java implementation, keytool to create a certificate