title: How current php function interprets to c#?
body: <p>i have php func,</p>
  
  <pre><code>private function signData($data) {
  $descriptorspec = array(
      0 =&gt; array("pipe", "r"),
      1 =&gt; array("pipe", "w"),
  );
  $descriptorspec[2] = $descriptorspec[1];
  try {
      $opensslCommand = 'openssl smime -sign -signer ' . $this-&gt;settings-&gt;mws_cert .
          ' -inkey ' . $this-&gt;settings-&gt;mws_private_key .
          ' -nochain -nocerts -outform PEM -nodetach -passin pass:'.$this-&gt;settings-&gt;mws_cert_password;
  
      $process = proc_open($opensslCommand, $descriptorspec, $pipes);
      if (is_resource($process)) {
          fwrite($pipes[0], $data);
          fclose($pipes[0]);
          $pkcs7 = stream_get_contents($pipes[1]);            
          fclose($pipes[1]);
          $resCode = proc_close($process);
          if ($resCode != 0) {
              $errorMsg = 'OpenSSL call failed:' . $resCode . '\n' . $pkcs7;                
              throw new \Exception($errorMsg);
          }
          return $pkcs7;
      }
  } catch (\Exception $e) {        
      throw $e;
  }}
  </code></pre>
  
  <p>I'm interested in how to run the command $opensslCommand in c#. </p>
  
  <p>My code c#:</p>
  
  <pre><code>var startInfo = new ProcessStartInfo(@"C:\OpenSSL\bin\openssl.exe", 
  @"smime -sign -signer d:\smime.p7s -inkey d:\private.key -nochain -nocerts -outform PEM -nodetach -passin pass:my_pass");
  Process.Start(startInfo);
  </code></pre>
  
  <p>But how to send in process this variable <strong>$descriptorspec</strong>?
  <br>
  And how execute this code in c#: </p>
  
  <pre><code>fwrite($pipes[0], $data);
  $pkcs7 = stream_get_contents($pipes[1]);
  </code></pre>