这是我创建ssl证书的代码 ProcessStartInfo info = new ProcessStartInfo (); 处理p =新进程(); info.FileName = Server.MapPath(@〜\ Bin \ makekert.exe); info.UseShellExecute = false; info.Verb =runas; //提供以管理员身份运行 info.Arguments = @ - n+ @CN = ExampleSSL+ @ - b 12/10/2013 -e 01/05 / 2014 -r -sky exchange -pe -sr localMachine -ss my -sp+ @Microsoft RSA SChannel Cryptographic Provider+ @-sy 12 -sv example.pvk; p.StartInfo = info; p.Start(); 这个没有例外的是同时没有创建证书。 请检查我的代号我错了 谢谢 purna
Hi, this is my code to create ssl certificate ProcessStartInfo info = new ProcessStartInfo(); Process p = new Process(); info.FileName = Server.MapPath(@"~\Bin\makecert.exe"); info.UseShellExecute = false; info.Verb = "runas"; // Provides Run as Administrator info.Arguments = @" -n " + @"""CN=ExampleSSL""" + @" -b 12/10/2013 -e 01/05/2014 -r -sky exchange -pe -sr localMachine -ss my -sp " + @"""Microsoft RSA SChannel Cryptographic Provider""" + @" -sy 12 -sv example.pvk"; p.StartInfo = info; p.Start(); in this no exception is raising at the same time no certificate is created. Please check my code where I did mistake thanks purna
推荐答案试试在需要显示 SSL证书 public void SSLCErtificate() { HttpWebRequest request =(HttpWebRequest)WebRequest.Create(adrBarTextBox.Text); HttpWebResponse response =(HttpWebResponse)request.GetResponse(); response.Close(); //检索ssl证书并将其分配给X509Certificate对象 X509Certificate cert = request.ServicePoint.Certificate; //将X509Certificate转换为X509Certificate2对象,方法是将其转换为构造函数 X509Certificate2 cert2 = new X509Certificate2(cert); //显示证书对话框 X509Certificate2UI .DisplayCertificate(cert2); } 感谢你 Try to call this fucntion where you need to display SSL Certificate public void SSLCErtificate() { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(adrBarTextBox.Text); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); response.Close(); //retrieve the ssl cert and assign it to an X509Certificate object X509Certificate cert = request.ServicePoint.Certificate; //convert the X509Certificate to an X509Certificate2 object by passing it into the constructor X509Certificate2 cert2 = new X509Certificate2(cert); //display the cert dialog box X509Certificate2UI.DisplayCertificate(cert2); } Thanking you
更多推荐
不在c#中创建SSl证书
发布评论