HTTPS implements secure web communication by encrypting HTTP traffic. the principle is that the server provides its X.509 certificate, which is the legal representative of the server. it uses an asymmetric key encryption system. the server provides its own public key in the certificate. the client receives the certificate while accessing the page and encrypts the HTTP request with the public key of the server. then, the encrypted ciphertext is sent to the server, and the server uses its own private key for decryption. generally, the client is rarely required to provide certificates.
How to generate a certificate
You can use the keytool that comes with Java to generate a certificate:
Generate the keystore:
Run the keytool-genkey-alias-keypass alias password-keyalg in the command line.AlgorithmName-keystore Certificate Name-validity certificate validity period days-keysize Key Length
If you want to change the keystore password, run keytool-keypasswd-alias-keypass original alias password-newpasswd new alias Password
Check the name of a keystore running keytool-list-v-keystore.
Generate CER (Security Certificate)
Certificate file generated by running keytool-export-alias-file-keystore name-storepass keystore password-RFC
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/myway_cn/archive/2006/07/27/984433.aspx