Code example for InvalidParameterSpecException

0
            if (paramSpec == DHParameterSpec.class)
            { 
                return currentSpec;
            } 
 
            throw new InvalidParameterSpecException("unknown parameter spec passed to DH parameters object.");
        } 
 
        protected void engineInit( 
            AlgorithmParameterSpec paramSpec) 
            throws InvalidParameterSpecException 
        { 
            if (!(paramSpec instanceof DHParameterSpec))
            { 
                throw new InvalidParameterSpecException("DHParameterSpec required to initialise a Diffie-Hellman algorithm parameters object");
            } 
 
            this.currentSpec = (DHParameterSpec)paramSpec;
        } 
 
        protected void engineInit(