Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top