Using probablePrime to generate a prime number. probablePrime (512, randomSeed);
I am trying to generate a random prime using the probablePrime method of the BigInteger class. this is the 6.5 agent for Lotus Notes that I am trying to work with.
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Random;
public class RSA{
public static BigInteger genPrimeNum(int bitlen, Random random){
return BigInteger.probablePrime(bitlen, random);
}
}
On compilation, I get an error about the probablePrime (int, java.util.Random) method not found in the BigInteger class
Please, help.
Thanks in advance!
+3
Himanshu.MarJAVA
source
to share
2 answers
probablePrime
is in Java since version 1.4. Is it possible that your environment is using an earlier version of Java?
+1
Jon Skeet
source
to share
Update notes to the latest version.
0
D.Bugger
source
to share