public static BigInteger probablePrime (int bitLength, Random rnd)

Returns a positive BigInteger that is probably prime, with the specified bitLength. The probability that a BigInteger returned by this method is composite does not exceed 2-100.

bitLength    bitLength of the returned BigInteger.
rnd    source of random bits used to select candidates to be tested for primality.

Returns:  a BigInteger of bitLength bits that is probably prime

ArithmeticException    bitLength < 2 or bitLength is too large.

See also:

Since:  1.4