How to import a security certificate into the Cacerts certificate library in Java

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.