Code example for InvalidKeyException

0
    { 
        CipherParameters        param;
 
        if (key == null)
        { 
            throw new InvalidKeyException("key is null");
        } 
         
        if (key instanceof JCEPBEKey)
        { 
            JCEPBEKey   k = (JCEPBEKey)key;
             
            if (k.getParam() != null)
            { 
                param = k.getParam();
            } 
            else if (params instanceof PBEParameterSpec)
            { 
                param = PBE.Util.makePBEMacParameters(k, params);
            } 
            else