Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4293144

DHParameterGenerator class doesn't set a default value for the exponentSize

XMLWordPrintable

    • 1.2.1ea
    • sparc
    • solaris_7

      In order to test the default initialization of AlgorithmParameterGenerator class, I use test code as follows:

        AlgorithmParameterGenerator paramGen =
      AlgorithmParameterGenerator.getInstance("DH");
       
        AlgorithmParameters params = paramGen.generateParameters();
        DHParameterSpec spec = (DHParameterSpec)
        params.getParameterSpec(DHParameterSpec.class);
        BigInteger bigG=spec.getG();
        BigInteger bigP=spec.getP();
        int randomExponent=spec.getL();

      see the attachment for complete code.
      after I run the code, I got the 0 value of randomExponent. Actually, this value is supposed to be the private key, so it can not be a fixed value.

            shihliu Sharon Liu (Inactive)
            skesunw Stuart Ke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: