11

Let say I run this command:

makecert testcert.cer

Is a private key created? If so, where is it automatically stored in the system even though I did not tell makecert to install this certificate in any certificate store?

4

3 回答 3

4

您运行命令的方式不会创建任何私钥。要使用私钥生成证书,您必须使用选项 -pe。但这还不够。仅当您的证书目的地是商店时才会创建私钥。所以你必须使用这样的命令:

makecert -pe -ss 我的 testcert.cer

“我的”对应于“个人”商店。

于 2009-07-21T10:38:44.733 回答
2

看起来私钥存储在文件本身中。从http://msdn.microsoft.com/en-us/library/bfsktky3(VS.80).aspx的文档中它指出......

注意
您应该使用证书存储来安全地存储您的证书。此工具使用的 .snk 文件以不受保护的方式存储私钥。当您创建或导入 .snk 文件时,您应该在使用过程中小心保护它,并在完成后将其移除。

于 2008-12-04T17:11:41.997 回答
0

未创建私钥,因为当我在 .NET 中加载证书时,我将 X509Certificate2 的 HasPrivateKey 设置为 false。

于 2009-01-31T23:45:59.173 回答