Any person having knowledge that a public offense has been committed and that a certain person committed it, and is not the husband or wife of the person who committed the offense, who harbors, aids or conceals the person who committed the offense, with the intent to prevent the apprehension of the person who committed the offense, commits an aggravated misdemeanor if the public offense committed was a felony or commits a simple misdemeanor or if the public offense was a misdemeanor.