convert .crt to .p12

ChatGPT said:

To convert a .crt file to a .p12 (PKCS#12) file, you’ll need:

  • Your certificate file (your_cert.crt)
  • The private key file (your_key.key)
  • (Optional) The CA bundle file (ca_bundle.crt)

You can use the openssl command like this:

bashCopyEditopenssl pkcs12 -export \
  -in your_cert.crt \
  -inkey your_key.key \
  -out your_cert.p12 \
  -name "your_alias" \
  -certfile ca_bundle.crt

Explanation:

  • -in your_cert.crt: Your certificate
  • -inkey your_key.key: Your private key
  • -out your_cert.p12: Output .p12 file
  • -name "your_alias": Alias for the key in the keystore
  • -certfile ca_bundle.crt: (Optional) Chain/intermediate certificates

Leave a comment