Skip to content

Instantly share code, notes, and snippets.

@kedwards
Last active October 17, 2023 13:10
Show Gist options
  • Save kedwards/d452c1d2209b6073d3a57f30df1f8597 to your computer and use it in GitHub Desktop.
Save kedwards/d452c1d2209b6073d3a57f30df1f8597 to your computer and use it in GitHub Desktop.
SSL – Convert PEM and private key to PKCS#12

PEM to PKCS12

SSL – Convert PEM and private key to PKCS#12

Convert cert.pem and private key key.pem into a single cert.p12 file, key in the key-store-password manually for the .p12 file.

openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem

No password

openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passout pass: -nokeys

Password is 123

openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passout pass: 123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment