openssl pkcs12 从命令行设置密码

问题描述

我有一个像这样的 bash 命令

#region

现在我会被要求输入密码来加密 .pfx 文件。那么有没有什么办法可以从命令行设置密码,不用每次都手动做这个操作?

解决方法

结果命令是

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