Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openssl pkcs12 set password from command line

Tags:

bash

openssl

pfx

I have a bash command like this

openssl pkcs12 -export -out ~/certificate.pfx -inkey /etc/letsencrypt/live/exapmle.com/privkey.pem -in /etc/letsencrypt/live/exapmle.com/cert.pem -certfile /etc/letsencrypt/live/exapmle.com/chain.pem

and now I'll be asked to enter a password to encrypt the .pfx file. So is there any way to set a password from command line to don't doing this operation manually every time?

like image 364
Petr Avatar asked Nov 16 '25 01:11

Petr


1 Answers

Resulting command is

openssl pkcs12 -password pass:your_password -export -out ~/certificate.pfx -inkey /etc/letsencrypt/live/exapmle.com/privkey.pem -in /etc/letsencrypt/live/exapmle.com/cert.pem -certfile /etc/letsencrypt/live/exapmle.com/chain.pem
like image 100
Petr Avatar answered Nov 17 '25 21:11

Petr