Code example for InvalidAlgorithmParameterException

0
 
        protected void engineInit( 
            AlgorithmParameterSpec  genParamSpec,
            SecureRandom            random)
            throws InvalidAlgorithmParameterException 
        { 
            throw new InvalidAlgorithmParameterException("No supported AlgorithmParameterSpec for DSA parameter generation.");
        } 
 
        protected AlgorithmParameters engineGenerateParameters()
        { 
            DSAParametersGenerator pGen = new DSAParametersGenerator();
 
            if (random != null)
            { 
                pGen.init(strength, 20, random);
            } 
            else 
            { 
                pGen.init(strength, 20, new SecureRandom());
            }