spikesource hints'n'tips

Our Top Tags

                                       

Mailing List

Keep uptodate with the latest hints'n' tips as they are published by signing up to our mailing list.

Our RSS Feeds








Latest Linux News

Free Software in Education

Sunday, 24 May 2009
Free Software: "Free Software is political because it is strongly tied with a deep political question: that of education, and access to it."

A Great Multi-Platform Music Management Application: Jajuk

Sunday, 24 May 2009
Web Upd8: "Jajuk is a very comprehensive and feature rich Open Source music management software written in Java. The software program is therefore available for Windows, Linux and Apple Macintosh comp

Kiwi Imaging System - Forge your own operating system images in a matter of hours

Saturday, 23 May 2009
Dedoimedo: "Would you like to be able to create custom, ready-to-use operating system images that can be used as VMware images, Xen virtual machines or live DVDs or booted from USB sticks? Would you l

Linux Myth: No Simple, Easy Database Software

Saturday, 23 May 2009
The ERACC Web Log: "In this installment of my Linux Myth series I take aim at the GNU/Linux database nay-sayers, and shoot them down."

Finding the right open-source savvy lawyer

Saturday, 23 May 2009
Practical Technology: "Some days, like it or not, you need a lawyer. For most business purposes, picking the right law firm isn’t usually that big of a deal"

Latest Digg Entries

How to import a certificate from file in Java using keytool

posted Wednesday, 17 August 2005
If you need to import a certificate not included as part of the JRE then you can do so using the keytool utility provided as part of the JRE/JDK installation.

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.

tags:  

links: digg this    del.icio.us    technorati    




1. bob left...
Monday, 24 October 2005 9:41 pm

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


2. John left...
Wednesday, 10 May 2006 8:03 pm

Thank you this solved my problem


3. Jimmy left...
Friday, 8 December 2006 2:47 am

Thanks a lot.


4. rnavarro left...
Tuesday, 4 March 2008 11:56 am

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


5. dsingh283 left...
Friday, 20 June 2008 2:41 pm

c:\java\jdk1.3\jre\bin\keytool -keystore "c:\java\jdk1.3\jre\lib\security\cacerts" -import

-file entrust.cer "c:\certificate" -alias cert1

i am trying to import entrust.cert into .keystore file. am i missing something in this .


6. dsingh283 left...
Friday, 20 June 2008 3:39 pm

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


Related Posts

How can I start a Java process and retain its process id?

Monday, 2 October 2006 2:41 P GMT
How can I start a Java process and retain its process id?

Handling different Java runtimes on a single machine

Thursday, 14 September 2006 10:48 A GMT
This entry takes a quick look at how you can best utilise different Java JVMs on the linux using a couple of techniques.

Invoking Jetty as an embedded server

Wednesday, 16 August 2006 2:24 P GMT
Ever wondered how to invoke Jetty as an embedded server? David Yu from the Jetty Mailing list recently posted a way you can do this.

How to install JMeter and use it for testing

Sunday, 11 September 2005 8:00 A GMT
Apache JMeter is a 100% pure Java desktop application designed to test performance on static/dynamic resources such as static files, Servlets, CGI scripts. JMeter can also be used to regression test application by creating test scripts.

Introduction to JVM crashes

Friday, 9 September 2005 10:33 A GMT
Things to look for when checking a JVM crash

Configuring JGroups to avoid using multicasting

Wednesday, 31 August 2005 7:54 A GMT
JGroups - the cluster library used by Jboss, uses multicasting for cluster communication. This article discusses configuration of JGroups so that it does not use multi casting.

How to import a certificate from file in Java using keytool

Wednesday, 17 August 2005 4:56 P GMT
How to import a certificate from file in Java using keytool