What is the correct way to pass the password to OpenSSL

1.8k views Asked by At

I am trying to setup a batch script to automate some of OpenSSL's more mundane tasks. The problem I am having, is that the typical 'passout' and 'pass' parameters still prompt for a password.

For example:

openssl genrsa -aes256 -out ca\private\root.key.enc 4096 -pass pass:somepassword

and

openssl genrsa -aes256 -out ca\private\root.key.enc 4096 -passout pass:somepassword

both result in still being prompted to enter a password. Could you please let me know what the correct parameter is. Using the stdin << also will not work as I am using windows. Eventually, I will be wrapping this in C# so the parameters need to be the ones included as actual parameters.

Thanks.

0

There are 0 answers