首页 > 解决方案 > openssl pkcs12 从命令行设置密码

问题描述

我有一个这样的 bash 命令

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

现在将要求我输入密码来加密 .pfx 文件。那么有什么方法可以从命令行设置密码以不每次都手动执行此操作?

标签: bashopensslpfx

解决方案


结果命令是

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

推荐阅读