Generated keys seem to lose a bit...
Using keytool, I'm generating 4096 bit RSA keys. The SSL connection gets established all right, and the encryption is happening, but I noticed something peculiar.
When I run my code with the option: -Djavax.net.debug=all I see this:
Found trusted certificate:
[
[
Version: V1
Subject: CN=first last, OU=division, O=company, L=town, ST=st, C=us
Signature Algorithm: MD5withRSA, OID = 1.2.840.113549.1.1.4
Key: Sun RSA public key, 4095 bits
...
]
]
I generated 512 bit keys and the debug message shows the key was 512 bits. I also tried this with a 5000 bit key and it showed 4999 bits.
Is there a reason these bigger keys are losing a bit?
Thanks
-matthew
(I've downloaded and configured the unlimited strength crypto. jar.)