Code example for InvalidKeySpecException

                return new JCEPBEKey(this.algName, this.algOid, scheme, digest, keySize, ivSize, pbeSpec, param);
            throw new InvalidKeySpecException("Invalid KeySpec");
    static public class DESPBEKeyFactory 
        extends JCESecretKeyFactory 
        private boolean forCipher;
        private int     scheme;
        private int     digest;
        private int     keySize;
        private int     ivSize;
        public DESPBEKeyFactory( 
            String              algorithm,
Connect your IDE to all the code out there  Get Codota for Java