为 .NET 中的客户端应用程序创建证书

发布于 2024-07-17 13:50:03 字数 193 浏览 6 评论 0原文

我正在寻找一个服务器应用程序,可以使用自签名根定期为客户端应用程序生成证书。 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

℡寂寞咖啡 2024-07-24 13:50:03

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.

酷到爆炸 2024-07-24 13:50:03

对于那些对在产品中使用“充气城堡”感到有点害怕的人,请查看 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.

你在我安 2024-07-24 13:50:03

早在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文