Generates a random public/private key pair, with a given key size. Different algorithms provide different degrees of security for the same key size, because of the "work factor" involved in brute force attacks. As computers become faster, it becomes easier to perform such attacks. Small keys are to be avoided.
Note that not all values of "keyBits" are valid for all algorithms, and not all public key algorithms are currently supported for use in X.509 certificates. If the algorithm you specified does not produce X.509 compatible keys, an invalid key exception is thrown.
@param keyBits the number of bits in the keys.
@exception InvalidKeyException if the environment does notprovide X.509 public keys for this signature algorithm.