File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

converting jks to p12 certificate

 
kona krishnakumar
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Please help me with below issue.

Iam converting server certs jks to pkcs12 certificate For that I had set the java path and enter the following command in command prompt.

keytool -importkeystore -srckeystore servercerts -destkeystore wallet.p12 -srcstoretype JKS -deststoretype PKCS12 -srcstorepass admin -deststorepass admin123 -srcalias renewals.deposits.com -destalias renewals.deposits.com -srckeypass admin -destkeypass admin123 -noprompt

I had successfully created pkcs12 certificate, but not able to check the information of certificate by using the below command

keytool -v -list -keystore wallet.p12

it is throwing following error

D:\Daytoday\oct\12102012\jks\jks>keytool -v -list -keystore wallet.p12

keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:633)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:3
8)
at java.security.KeyStore.load(KeyStore.java:1185)
at sun.security.tools.KeyTool.doCommands(KeyTool.java:620)
at sun.security.tools.KeyTool.run(KeyTool.java:172)
at sun.security.tools.KeyTool.main(KeyTool.java:166)

How can I confirm, whether the converted jks to p12 cert successfully or not. Kindly share your suggestions

Thanks
Krishna
 
Richard Tookey
Bartender
Pie
Posts: 1166
17
Java Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you have specified

-deststoretype PKCS12

when creating the keystore you need to specify PKCS12 when listing the content.

keytool -v -list -storetype PKCS12 -keystore wallet.p12
 
kona krishnakumar
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. It has worked.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic