tags:

views:

53

answers:

2

Given an java.security.interfaces.RSAKey, how do I get it's size?

+3  A: 

You could try this:

key.getModulus().bitLength();
David M
+1  A: 

The size of an RSA key is the number of bits in its modulus, so you want myRSAKey.getModulus().bitLength().

JacobM