2013-08-30 64 views
0

我已經能夠生成密鑰以及使用Openssl的命令像以下行通過C#過程生成CSR出的鍵的命令,我不能在SCR使用此代碼上面的代碼生成:HOWTO符號CSR在C#過程

 startInfo.Arguments = @"ca -batch -keyfile ..\..\ca\ca.key -cert ..\..\ca\cacert.pem -in ..\..\Certificates\client.req -outform PEM -out client.pem"; 

     Console.WriteLine("Signing Cert..."); 
     System.Diagnostics.Process p= System.Diagnostics.Process.Start(startInfo); 
    //This step is executed without error but does not generate the signed certificate client.pem. 
    //Strangely enough, this command works fine when executed in the openssl shell and it does generate the signed client.pem 
     p.WaitForExit(); 
     Console.WriteLine("Signing done"); 

    } 

我試過當命令被執行,看看哪裏出了問題,但我不知道該怎麼做,在VS2012調試Openssl的。正如我所說的,簽名命令在openssl shell中工作正常,但它在這裏不起作用,並且不會引發任何錯誤。

有什麼想法?

回答

0

我能解決它,只需將index.txt和serial.txt移動到bin目錄。

就是這樣。