The question is how to import the .cer file into the trust store, but I have a .crt file that I exported from Firefox.
A web search on how to import .crt to trust the repository points to this question. Since I learned how to import .crt into the trust repository, I am also responding to this.
Answer: the same as for .cer files.
By the way, you do not need to specify an alias, and you can enter the keystore password after entering the command:
keytool -v -import -file somefile.crt -alias somecrt -keystore my-cacerts
It is preferable to use the cacerts file, which is already in your Java installation (jre \ lib \ security \ cacerts), since it contains already secure "popular" certificates.
Update on the differences between cer and crt (just for clarification) According to Apache with SSL - how to convert CER certificates to CRT? and user @Spawnrider
CER is an X.509 certificate in binary form encoded by DER.
CRT is an X.509 binary certificate encapsulated in text (base-64) encoding.
This is not the same coding.
Andreas Panagiotidis Sep 14 '16 at 20:24 2016-09-14 20:24
source share