C# Windows 证书存储

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/832868/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 03:26:31  来源:igfitidea点击:

Windows certificate store

c#.netwindowssslcertificate

提问by Syam

Where can I find the windows certificate store location on the hard drive for server 2003. I am coding a c# utility for managing few certificates we use to notify when they are expiring. So, I choose to store them in the windows certificate store. Instead of using any existing location(Personal...) that I see in MMC I would like to create another location with my application name and a place(eg: 'c:\certs') of my choice, so that I can back up.

在哪里可以找到服务器 2003 硬盘驱动器上的 Windows 证书存储位置。我正在编写 ac# 实用程序,用于管理一些我们用来在它们到期时通知的证书。因此,我选择将它们存储在 Windows 证书存储中。我不想使用我在 MMC 中看到的任何现有位置(个人...),而是想使用我的应用程序名称和我选择的位置(例如:'c:\certs')创建另一个位置,以便我可以返回向上。

采纳答案by user8032

I strongly suspect that you don't need to create your own location. Do you have a good reason for wanting one? Windows has APIs to manage certificates, and I would suggest looking into those. I am pretty sure you can do all reasonable things though the public API. If you use the APIs with the system store, you will likely have to write less code, and your resulting solution will be more secure, better integrated with the OS (and all the OTHER tooling built for dealing with certs on windows)

我强烈怀疑您不需要创建自己的位置。你有充分的理由想要一个吗?Windows 有 API 来管理证书,我建议研究这些。我很确定你可以通过公共 API 做所有合理的事情。如果您将 API 与系统存储一起使用,您可能需要编写更少的代码,并且您生成的解决方案将更安全,与操作系统更好地集成(以及为处理 Windows 上的证书而构建的所有其他工具)

回答by user8032

(Forgive the late reply)

(原谅迟到的回复)

I'm not sure on this one Syam, but at least the private keys involved in the certificates could be here: C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto

我不确定这个 Syam,但至少证书中涉及的私钥可能在这里:C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto

Again, this is not something I'm sure of.

再说一次,这不是我确定的。

回答by dnk.nitro

I know this kind of old question, but when I was looking for an answer to the similar question, I was able to find that certificate information is stored in the windows registry, not in the regular files: http://technet.microsoft.com/en-us/library/cc787544(WS.10).aspx#w2k3tr_certs_tools_dgzz

我知道这种老问题,但是当我寻找类似问题的答案时,我发现证书信息存储在 Windows 注册表中,而不是常规文件中:http: //technet.microsoft。 com/en-us/library/cc787544(WS.10).aspx#w2k3tr_certs_tools_dgzz

回答by user2097524

one can use makecert.exe to create a new store

可以使用 makecert.exe 创建一个新存储

makecert.exe -sr localmachine -ss

makecert.exe -sr localmachine -ss

you can download the tool from here http://gallery.technet.microsoft.com/Certificate-Creation-tool-5b7c054d

您可以从这里下载该工具http://gallery.technet.microsoft.com/Certificate-Creation-tool-5b7c054d