DEV Community

Franz Wong
Franz Wong

Posted on

Add Hongkong Post Root CA certificate to Java keystore

Problem

I can't find Hongkong Post Root CA in Java 17 cacerts. I need to download and import it.

Steps

  1. Download from Hongkong Post

Please download "Hongkong Post Root CA 3".

Hongkong post cert download link

2. Execute the following command in terminal

sudo keytool -import -alias hongkongpostrootca3 -file ~/Downloads/root_ca_3_pem.cer -cacerts
Enter fullscreen mode Exit fullscreen mode

~/Downloads/root_ca_3_pem.cer is the file path of certificate downloaded in previous step.

hongkongpostrootca3 is just alias. You can give a different name.

3. It will ask for keystore password. The default one is changeit.

4. It will ask to confirm with message "Trust this certificate?". Just enter yes.

5. The root CA is imported. We can check it with the following command.

sudo keytool -list -alias hongkongpostrootca3 -cacerts
Enter fullscreen mode Exit fullscreen mode

Top comments (0)