Solved

Import p12 file using keytool

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Ransomware is a growing menace to anyone using a computer or mobile device. Here are answers to some common questions about this vicious new form of malware.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 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