I’m trying to convert a P12 file to a PEM file. When I execute the command, the terminal asks me for three things:
P12 passphrase (I type it in, hit enter)
PEM passphrase (type it in, hit enter)
PEM passphrase confirm (type it in, hit enter)
I know I can execute a sudo command all in one shot by using the following:
echo sudopassword | sudo rm -rf /file.p12;
How can I add all three values in one shot? Thanks
Can you explain what these P12 files are? I found this link which deals with the conversion of pkcs12 Cert/key files to .PEM format using
openssl. (http://gridsite.org)Key to the answer is:
Use
-passin file:...and-passout file:...for unattended processingIt’s my guess that you will have to specify the
-passin file:P12passphraseand-passout file PEMpassphraseoptions for this case.This little test confirms how an input passphrase can be specified through a
file:<...>parameter. This helps to hide such phrases from any over the shoulder attacks. Don’t forget to restrict access to such files. Even though it’s a common feature of most openssl commands, it’s not explicitly mentioned and it is key to the original question. The full list of options is below.(I leave it to the OP to construct the full command.)
Below are all supported options for the
pkcs12subcommand: