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.
+1
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
Kamyar
2010-10-26 13:04:58
Thank you Kamyar.
swisstony
2010-10-26 13:22:27
No Problem tony.
Kamyar
2010-10-27 05:50:54