Code example for DSAParameterSpec

Methods: getGgetPgetQ

0
        { 
            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;
    } 
 
    public KeyPair generateKeyPair()
    { 
        if (!initialised)
        { 
            DSAParametersGenerator pGen = new DSAParametersGenerator();
 
            pGen.init(strength, certainty, random);
            param = new DSAKeyGenerationParameters(random, pGen.generateParameters());
            engine.init(param);
Stop searching for code, let great code find you!  Add Codota to your java IDE