EN
Bash - convert *.pem files to *.p12 file (cert.pem and key.pem to keystore.p12)
3
points
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:
andVerifying - Enter Export Password:
will be used to securekeystore.p12
file - they will be necessary later to readp12
file back.
Final result: