证书安装安全警告解决方法?
我有一些 C# 4.0 代码,尝试将 CA(.der 编码)证书安装到当前(我的)用户的“受信任的根证书颁发机构”存储中。我的小控制台应用程序在其他商店中静默运行,但对于此商店,会出现一个 GUI 弹出窗口“您即将安装来自证书颁发机构的证书...Windows 无法验证该证书实际上来自...吗?想要安装这个证书吗?”
这个消息框是一个问题,因为其想法是使用 MSI 自动部署应用程序,并在正确的位置默默地获取正确的证书。拥有模式框将杀死自动化部署。
如何在不出现破坏部署的消息框的情况下完成此安装?
I have some C# 4.0 code that attempts to install a CA (.der encoded) certificate into the "Trusted Root Certification Authorities" store for the current (My) user. My little console app runs silently against other stores, but for this store a GUI popup comes up "You are about to install a certificate from a certification authority... Windows cannot validate that the certificate is actually from..... Do you want to install this certificate?"
This messagebox is a problem because the idea is to automatically deploy the app with an MSI and silently get the right certs in the right place. Having a modal box will kill automated deployment.
How can this installation be done without a deployment-breaking messagebox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这听起来不合逻辑,但为了没有警告,您不应该将证书添加到当前用户的根证书存储中,而是添加到本地计算机的根证书中。您可以轻松验证是否
会产生安全警告,但事实
并非如此。
因此,如果您想在.NET中导入证书,那么相应的代码可能如下
It can sound not logical, but to have no warning you should add the certificate not to the Root certificate store of the current user, but to the Root of the local machine instead. You can easy verify that
produce the security warning, but
not.
So if you want import a certificate in .NET then the corresponding code could be about following