This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Security and the fly likes to convert jks format to pkcs7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "to convert jks format to pkcs7" Watch "to convert jks format to pkcs7" New topic

to convert jks format to pkcs7

Megha Singhal
Ranch Hand

Joined: Feb 28, 2012
Posts: 225

i want to convert keystore file to p7 format.
how can i do that?
Pondurai Singh
Ranch Hand

Joined: Jun 27, 2011
Posts: 35
Convert JKS to PKCS#12 then PKCS#12 to PKCS#7

keytool -importkeystore -srckeystore myks.jks -destkeystore mystore.p12 -srcstoretype JKS -deststoretype PKCS12 -srcstorepass mypwd -deststorepass mypwd -srcalias myalias -destalias myalias -srckeypass mypwd -destkeypass mypwd -noprompt
Export private key
openssl pkcs12 -in mystore.p12 -out mykey.pem -passin pass:mypwd -passout pass:mypwd

To convert a PKCS#12 certificate to PKCS#7 format:
  • Open the certificate file in Internet Explorer.
  • Note: Verify that the certificate chain is complete, including root and intermediate certificates.
  • In the Details tab, click Copy to File. The Certificate Export wizard appears.
  • Specify PKCS#7 format, include all certificates in the certification path, and then click Next.
  • Specify a filename and click Next.
  • Click Finish to export the file in PKCS#7 format. The file is saved with a .P7B extension.

  • Software Developer, Oracle Java Certification Training Labs at EPractize Labs.
    I agree. Here's the link:
    subject: to convert jks format to pkcs7
    It's not a secret anymore!