1
我正在創建這個將創建我自己的證書的簡單控制檯應用程序。這是我的代碼。在創建證書時未處理的密碼異常
var fi = new FileInfo("certificate.cer");
if (!fi.Exists)
{
var startInfo = new ProcessStartInfo();
startInfo.FileName = "makecert.exe";
startInfo.Arguments = "-sv SignRoot.pvk -cy authority -r sha1 -n \"CN=Certificate\" -ss my -sr localmachine certificate.cer";
Process.Start(startInfo);
}
X509Certificate.CreateFromCertFile("certificate.cer");
但是爲什麼我在最後一行代碼中得到這個?
CryptographicException was unhandled.
Message=The system cannot find the file specified.
它沒有工作.. –