Code example for InvalidKeySpecException

0
                } 
                 
                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,
            DERObjectIdentifier oid,