Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 bash,如何使用给定的密码将目录完整的 .pem 文件(使用 CERTIFICATE 和 RSA PRIVATE KEY)转换为 pkcs12 (.p12) 格式?我有 1,000 个 .pem 文件要转换,不想一个接一个地转换。
for f in *.pem; do openssl pkcs12 -export -out "`basename $f .pem`.p12" -inkey "$f" -in "$f" -certfile ./myca.pem -password pass:myPass; done
其中“myPass”(无引号)是密码,myca.pem 是 CA。