为 .NET 中的客户端应用程序创建证书
我正在寻找一个服务器应用程序,可以使用自签名根定期为客户端应用程序生成证书。 .NET 中是否有任何简化的流程来以编程方式生成这些证书?
当然,我可以继续生成 makecert 或 openssl,但当您只需在输出中获取 X509Certificate 时,我一直在寻找更具编程性的内存中方法。
如果有人有代码片段,可以分享吗?
I'm looking for a server app to be routinely generating certificates for client applications using self-signed root. Is there any streamlined process in .NET to programmatically generate those certificates?
I can, of course, keep spawning makecert or openssl, but I was looking for more programmatic, in-memory method, when you just get X509Certificate on output.
If someone got a code snippet, can you please share?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Bouncycastle.org 有 C# 绑定。 它可以创建X509证书。 该提供程序被 java webapps 广泛使用。
Bouncycastle.org has a C# binding. It can create X509 certificates. This provider is widely used by java webapps.
对于那些对在产品中使用“充气城堡”感到有点害怕的人,请查看 CodePlex 上的 CLR 安全团队网站< /a>. 他们在那里得到了很多好处,包括一个用于制作 x509 证书的库。
For people a bit freaked out about using a "bouncy castle" in their products, check out the CLR security team's site at CodePlex. They got lots of goodness in there, including a library for making x509 certs.
早在 2004 年,我就在这个领域做了一些工作,当时还没有这样的 .NET 解决方案。 我们编写了一个包装类,只是将其封装到 openssl 中。 正如你所描述的那样。
我们认为最好坚持使用众所周知的(和使用过的)解决方案,而不是尝试重新发明轮子!
好吧,自从我上次看到这个以来已经有一段时间了,但我很想说“如果它没有坏,就不要修复它”。
I did some work in this area back in 2004 and no such .NET solutions existed then. We wrote a wrapper class that simply shelled out to openssl. Much as you describe.
We figured it was best to stick with a well known (and used) solution than attempt to reinvent that wheel!
OK, it's been a while since I last looked at this but I'd be tempted to say "if it isn't broken don't fix it" on this one.