Solved

Import p12 file using keytool

Posted on 2008-09-29
1
7,810 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
wordmultiple challenge 12 90
Connect to MS-SQL server from Linux/PHP 8 64
Header of docx file 17 58
Java JRE greater than 1.6 5 21
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
When the confidentiality and security of your data is a must, trust the highly encrypted cloud fax portfolio used by 12 million businesses worldwide, including nearly half of the Fortune 500.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now