code:     public void initialize(
          AlgorithmParameterSpec params,
          SecureRandom random)
          throws InvalidAlgorithmParameterException
      {
          if (!(params instanceof DSAParameterSpec))
          {
              throw new InvalidAlgorithmParameterException("parameter object not a DSAParameterSpec");
          }
          DSAParameterSpec dsaParams = (DSAParameterSpec)params;
  
          param = new DSAKeyGenerationParameters(random, new DSAParameters(dsaParams.getP(), dsaParams.getQ(), dsaParams.getG()));
  
          engine.init(param);
          initialised = true;
      }
  
  