How to pass more than one argument using Process + Openssl

Asked

Viewed 146 times

1

Using the following code I pass a certain argument, then I need to pass a password that Openssl requests, but how do I do that? I tried the StandardInput but I received an exception:

Additional information: Standardin was not redirected

 Dim procAssin As New Process()
    With procAssin.StartInfo
        .UseShellExecute = False
        .RedirectStandardOutput = True
        .RedirectStandardError = True
        .StandardOutputEncoding = Encoding.GetEncoding("Windows-1252")

        .FileName = "C:\OpenSSL\openssl.exe"

        .WorkingDirectory = "C:\certificado\bin"

        .Arguments = "pkcs12 -in C:\Cert\certificado.pfx -out C:\Cert\certificado.pem -nodes"

    End With

    procAssin.Start()

  procAssin.StandardInput.WriteLine("SENHA")
  • 2

    Tried to add myProcess.StartInfo.RedirectStandardInput = true; also?

  • Really, that was it. Lack of attention from me. No longer gave the error, but did not add the password too, It is strange that when you open the console I also can not write on it, have idea what can be?

  • I answered not to leave the question open.

  • Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?

1 answer

1

Linking this property resolves:

myProcess.StartInfo.RedirectStandardInput = true;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.