In Java, there is a limitation on key size by the JCE Jurisdiction Policy. If you manipulate a private key with bit size which is larger than the limitation, it will throw a InvalidKeyException complaining about Illegal key size.
The following piece of Java code will check maximum key size of all the algorithms and print the result to the console. Continue reading Java Cryptography Extension – Check Maximum Allowed Key Size