x = new BigInteger(qLength, param.getRandom());
BigInteger pSub2 = p.subtract(TWO);  do { x = new BigInteger(pLength, param.getRandom()); } while (x.equals(ZERO) || x.compareTo(pSub2) > 0);
    public AsymmetricCipherKeyPair generateKeyPair()    {        BigInteger           p, g, x, y;        int                  qLength = param.getStrength() - 1;        ElGamalParameters    elParams = param.getParameters();        p = elParams.getP();        g = elParams.getG();            //        // calculate the private key        //        x = new BigInteger(qLength, param.getRandom());        //        // calculate the public key.        //        y = g.modPow(x, p);        return new AsymmetricCipherKeyPair(                new ElGamalPublicKeyParameters(y, elParams),                new ElGamalPrivateKeyParameters(x, elParams));    }