如何获取证书的密钥大小
我有一个 X.509 证书,需要获取其密钥的大小(以位为单位) - 例如,1024 2048 等。我查看了 X509Certificate2 以及 bouncycastle X509Certificate 类,但不知道如何获取密钥大小。
I have an X.509 certificate and need to get the size of its key (in bits) - e.g., 1024 2048 etc. I have looked at X509Certificate2 and also the bouncycastle X509Certificate classes but can't see how to get the key size.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您当然可以访问公钥。密钥长度是公钥的大小:
this.PublicKey.Key.KeySize;
要查看已实施的解决方案,请查看MSDN 上的这篇文章< /a>
You surely have access to the public key. The key length is public key's size:
this.PublicKey.Key.KeySize;
To see an implemented solution, check out this article on MSDN