Languages
[Edit]
EN

Bash - convert *.pem files to *.p12 file (cert.pem and key.pem to keystore.p12)

0 points
Created by:
Greg
5810

In this short article we would like to show how to convert public certificate with private key saved as *.pem files into *.p12 keystore using command line.

Run following command:

openssl pkcs12 -export -in public_certificate.pem -inkey private_key.pem -out keystore.p12

or with certificate / key alias:

openssl pkcs12 -export -in public_certificate.pem -inkey private_key.pem -out keystore.p12 -name my-alias

 

Notes:

  • we will be asked to type new password for created keystore.p12 file,
  • it is recommended to use Command Line under┬áWindows (cmd.exe).

Example output:

Enter Export Password:
Verifying - Enter Export Password:

Where:

  • Enter Export Password: and Verifying - Enter Export Password: will be used to secure┬ákeystore.p12 file - they will be necessary later to read file back.

Screenshot:

*.pem to *.p12 conversion (cert.pem and key.pem to keystore.p12)
*.pem to *.p12 conversion (cert.pem and key.pem to keystore.p12)

References

  1. Privacy-Enhanced Mail - Wiki
  2. PKCS #12 / *.p12 file format - Wiki

Native Advertising
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join