Using bash, how do I convert a directory full .pem files (with CERTIFICATE and RSA PRIVATE KEY) into pkcs12 (.p12) format with a given password? I have 1,000 .pem files to convert and don't want to do it one-by-one.

有帮助吗?

解决方案

for f in *.pem; do openssl pkcs12 -export -out "`basename $f .pem`.p12" -inkey "$f" -in "$f" -certfile ./myca.pem -password pass:myPass; done

Where 'myPass' (no quotes) is the password, and myca.pem is the CA.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top