如何以编程方式在.NET中创建X.509证书? [英] How to programmatically create an X.509 certificate in .NET?

查看:372
本文介绍了如何以编程方式在.NET中创建X.509证书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在.NET中创建一个新的X.509证书,以满足我设置的哈希算法和密钥长度要求。这将是一个自签名证书。创建新证书可能会创建一个新的密钥,或者我想导入一个现有的私有密钥,我有在byte []形式。

I'd like to create a new X.509 certificate in .NET, that meet the hash algorithm and key length requirements that I set. This will be a self-signed certificate. Creating a new certificate may create a new key, or perhaps I'd like to import an existing private key that I have in byte[] form.

有人知道如何做吗?

推荐答案

a href =http://blogs.msdn.com/b/dcook/archive/2008/11/25/creating-a-self-signed-certificate-in-c.aspx =nofollow noreferrer>这post 可能很有帮助。我在测试环境中使用此代码创建自签名证书。

Maybe this post can be helpful. I use this code in our test environment to create self signed certificates.

最好

这篇关于如何以编程方式在.NET中创建X.509证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆