Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create pkcs12 truststore using openssl

I can export a Java truststore (JKS file with only certificates, no private key), using the keytool command to a p12 file:

keytool -importkeystore -srckeystore truststore.jks -destkeystore truststore.p12 -deststoretype PKCS12

However, I can't seem to figure out how I could create the same file using the 'openssl pkcs12' command. It allows you to pass in certificates, but every option I've tried requires the user to pass in the private key.

like image 488
Matt Hughes Avatar asked Aug 11 '14 16:08

Matt Hughes


People also ask

What is PKCS12 Truststore?

PKCS#12 (P12) files define an archive file format for storing cryptographic objects as a single file. API Connect supports the P12 file format for uploading a keystore and truststore. The keystore should contain both a private and public key along with intermediate CA certificates.


1 Answers

openssl pkcs12 -export -nokeys -in certificate.cer -out pkcs12.pfx

like image 112
jariq Avatar answered Sep 20 '22 13:09

jariq