Code example for InvalidParameterSpecException

0
            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( 
            byte[] params) 
            throws IOException 
        { 
            try 
            { 
                RSAESOAEPparams oaepP = RSAESOAEPparams.getInstance(params);
 
                currentSpec = new OAEPParameterSpec(
                                       oaepP.getHashAlgorithm().getAlgorithm().getId(),