public BigInteger (int bitLength, int certainty, Random rnd)

Constructs a randomly generated positive BigInteger that is probably prime, with the specified bitLength.

bitLength    bitLength of the returned BigInteger.
certainty    a measure of the uncertainty that the caller is willing to tolerate. The probability that the new BigInteger represents a prime number will exceed (1 - 1/2 certainty). The execution time of this constructor is proportional to the value of this parameter.
rnd    source of random bits used to select candidates to be tested for primality.

ArithmeticException    bitLength < 2 or bitLength is too large.

See also:

@apiNote It is recommended that the probablePrime method be used in preference to this constructor unless there is a compelling need to specify a certainty.