Code example for InvalidParameterSpecException

0
            if (paramSpec == OAEPParameterSpec.class && currentSpec != null)
            { 
                return currentSpec;
            } 
     
            throw new InvalidParameterSpecException("unknown parameter spec passed to OAEP parameters object.");
        } 
     
        protected void engineInit( 
            AlgorithmParameterSpec paramSpec)
            throws InvalidParameterSpecException 
        { 
            if (!(paramSpec instanceof OAEPParameterSpec))
            { 
                throw new InvalidParameterSpecException("OAEPParameterSpec required to initialise an OAEP algorithm parameters object");
            } 
     
            this.currentSpec = (OAEPParameterSpec)paramSpec;
        } 
     
        protected void engineInit(