In project development, sometimes encounter with SSL security certificate import to deal with, how to import the certificate into Java cacerts Certificate library? In fact, it is very simple, the method is as follows:
Every step: Go to a Web site at the beginning of a https://www.xxx.com, download the certificate you want to import.
On the page, right-click >> properties >> Tap Certificates >>
Then click on the "more info" Toggle bar above >>
Then click on the "Copy to File" button in the lower right corner.
It will pop up a Certificate Export Wizard dialog box, follow the prompts step by step to complete the line.
For example: Save As Abc.cer, placed under C drive
The second step: How to import the above step (abc.cer) This certificate into the Cacerts certificate library in Java?
Methods are as follows
Assuming that your JDK is installed in the C:\jdk1.5 directory,
Start >> run >> input cmd into DOS command line >>
Then use the CD to enter the C:\jdk1.5\jre\lib\security directory.
Enter the following command to execute
Keytool-import-alias Cacerts-keystore Cacerts-file D:\software\AKAZAM-Mail.cer-trustcacerts
At this point, the command line prompts you to enter the password for the Cacerts certificate store.
You just typed in Changeit, which is the default password for the Cacerts certificate store in Java.
You can also modify it yourself.
OK, you are done!
When you update later, delete the original certificate, and then import the new certificate
Keytool-list-keystore Cacerts
Keytool-delete-alias Akazam_email-keystore Cacerts
Keytool-import-alias akazam_email-file Akazam_email.cer-keystore Cacerts-trustcacerts
How to import a security certificate into the Cacerts certificate library in Java