Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Import p12 file using keytool

Posted on 2008-09-29
1
7,840 Views
Last Modified: 2013-11-23
I was just given a p12 file and told to import this file into my keystore.  I've tried a couple of different methods using keytool, but I get errors.  I'm sure I'm using it wrong, but was hoping that someone could point me in the right direction.  Thanks

C:\test>keytool -keystore "C:\Program Files\Java\j2re1.4.2_01\lib\security\cacer
ts" -import -file giftcards.p12 -storetype pkcs12 -trustcacerts -alias TestCert
keytool error: java.io.IOException: DerInputStream.getLength(): lengthTag=109, t
oo big.

0
Comment
Question by:jhughes4
1 Comment
 
LVL 5

Accepted Solution

by:
muktajindal earned 500 total points
ID: 22603177
You may use an alternate approach. Get a .cer equivalent for this p12 file and then import that .cer file to your keystore.

- Open IE. Go to Tools --> Internat Options --> Content --> Certificates.
- Click on "Import". Certificate Export Wizard window will be opened. (This window may also be opened by directly double-clicking on p12 file)
- Import p12 file here.
- After successful import, it will be listed in the certificates list.
- Select it. "Export" button will be enabled. Click on it. Certificate Export Wizard window will be opened.
- In the format option, select DER encoded binary X.509 (.CER)
- Finally, you will have a .cer file, say giftcards.cer.
- Import it into your keystore using following command :
keytool -keystore "C:\Program Files\Java\j2re1.4.2_01\lib\security\cacerts" -import -file giftcards.cer -trustcacerts -alias TestCert

HTH,
Mukta.
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 68
running on tomcat not jboss eap 7.0 3 18
Java 8 to Java 6 8 21
sftp vs SendThisFile 9 27
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question