File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Import .cer(public key) into .pfx Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Import .cer(public key) into .pfx" Watch "Import .cer(public key) into .pfx" New topic
Author

Import .cer(public key) into .pfx

siva kumarl
Greenhorn

Joined: Nov 29, 2008
Posts: 21
Hi Friends,
I generated a keystore file(.jks) which contains both public key and private key, i converted it .pfx file, but this contains only private, now i have to import the public key into .pfx , i am getting the following error. Friends kindly help me. please find the below errordetails:

c:/>keytool -import -v -trustcacerts -alias kiwiservice -file kiwiclient.cer -keyst
ore kiwiservice.pfx -storetype pkcs12
Enter keystore password:********
Owner: CN=CLIENT, OU=YALAMANCHILI_CLIENT, O=YSE, L=VSP, ST=AP, C=IN
Issuer: CN=CLIENT, OU=YALAMANCHILI_CLIENT, O=YSE, L=VSP, ST=AP, C=IN
Serial number: 4b31954e
Valid from: Wed Dec 23 09:28:06 IST 2009 until: Tue Dec 22 09:28:06 IST 2015
Certificate fingerprints:
MD5: C8:C9:89:E2:CA:F9:30:AF:7A0:9AD:5F:F5:18:78
SHA1: BA:F9:F8:82A:54:26:1B:2B:22:18:88:AA:792:E30:13:F1:B9
Signature algorithm name: SHA1withRSA
Version: 3
Trust this certificate? [no]: y
keytool error: java.security.KeyStoreException: TrustedCertEntry not supported
java.security.KeyStoreException: TrustedCertEntry not supported
at com.sun.net.ssl.internal.pkcs12.PKCS12KeyStore.engineSetCertificateEn
try(PKCS12KeyStore.java:620)
at java.security.KeyStore.setCertificateEntry(KeyStore.java:941)
at sun.security.tools.KeyTool.addTrustedCert(KeyTool.java:1954)
at sun.security.tools.KeyTool.doCommands(KeyTool.java:814)
at sun.security.tools.KeyTool.run(KeyTool.java:171)
at sun.security.tools.KeyTool.main(KeyTool.java:165)


kindly help me to import .cer into .pfx file

Thanks in Advance
---------------
Siva
Yaron Naveh
Greenhorn

Joined: Oct 26, 2008
Posts: 24
See here how to do the conversion in one shot:

http://travisspencer.com/blog/2009/10/exporting-keys-from-a-jks-and.html

[url]http://webservices20.blogspot.com/[/url]
Web Services Performance, Interoperability And Testing Blog
rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Yaron Naveh wrote:See here how to do the conversion in one shot:

http://travisspencer.com/blog/2009/10/exporting-keys-from-a-jks-and.html


I have also created .keystore using java keytool now i want to convert it into .pfx format....what should i do for this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Import .cer(public key) into .pfx
 
Similar Threads
SSLHandshakeException
Enable Security for JBoss + WS
Tomcat 4.1: JDK 1.4.2 Keystore issue?
RMI - SSL - VeriSign Certificates
Keytool import problem