keytool -keystore <path to keystore> -import -file <path to certificate> -alias <alias>
Accessing https://bugzilla.mozilla.org using a default installation of JRE 1.4.2_04 is not possible without importing the Mozilla certificate or one of the certificates in the trust hierarchy (GlobalSign Root CA, GlobalSign RootSign Partners CA, or XRamp Security Services GS CA).
The first step is to get the certificate as a file. The easiest way to do this is to surf to https://bugzilla.mozilla.org/ in Internet Explorer, go to File, then Properties. On the popped up Properties you'll see a "Certificates" button in the bottom right hand side. Click on that, select the Details tab, then "Copy to File..". Follow the wizard through saving as "DER encoded binary X.509". Name your file mozilla.cer. (Alternatively if you wish to install one of the other certificates in the chain they should be downloadable from their websites.)
Now enter the following at a DOS prompt where "c:\Program Files\Java\j2re1.4.2_04" can be substituted for your own java installation path:
keytool -keystore "c:\Program Files\Java\j2re1.4.2_04\lib\security\cacerts" -import -file mozilla.cer -alias mozilla
On executing this, you'll be prompted for a password which should be "changeit" (the default). Then enter "yes" to finish.
Hi,
It you do not want to use command line,
there is a free GUI version called KeyTool IUI, see
http://yellowcat1.free.fr/index_ktl.html
Hi, I need to know how to import a certificate froma a keystore PKCS12 to a
UBER keystore. With keyToolIUI it works perfectly but I need the source
code, I've used java.security.keystore but it doesn't work
thks
c:\java\jdk1.3\jre\bin\keytool -keystore
"c:\java\jdk1.3\jre\lib\security\cacerts" -import
c:\java\jdk1.3\jre\bin\keytool -import -file "c:\certificate\entrust.cer"
-keystore "c:\java\jdk1.3\jre\lib\security\cacerts" -alias cert1
.... Now its working.. but i am still getting. Untrusted server cert chain exception