开发者

How do I get certificate's key size

开发者 https://www.devze.com 2023-01-22 13:45 出处:网络
I have an X.509 certificate and need 开发者_C百科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

I have an X.509 certificate and need 开发者_C百科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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消