Solved

Import p12 file using keytool

Posted on 2008-09-29
1
7,856 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
[X]
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
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

Provide an easy one stop to quickly get the relevant information on common asked question on Ransomware in Expert Exchange.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

623 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