1. Except as otherwise provided in this section, a person who goes armed with a dangerous weapon concealed on or about the person, or who, within the limits of any city, goes armed with a pistol or revolver, or any loaded firearm of any kind, whether concealed or not, or who knowingly carries or transports in a vehicle a pistol or revolver, commits an aggravated misdemeanor.
2. A person who goes armed with a knife concealed on or about the person, if the person uses the knife in the commission of a crime, commits an aggravated misdemeanor.
3. A person who goes armed with a knife concealed on or about the person, if the person does not use the knife in the commission of a crime:
a. If the knife has a blade exceeding eight inches in length, commits an aggravated misdemeanor.
b. If the knife has a blade exceeding five inches but not exceeding eight inches in length, commits a serious misdemeanor.
4. Subsections 1 through 3 do not apply to any of the following:
a. A person who goes armed with a dangerous weapon in the person’s own dwelling or place of business, or on land owned or possessed by the person.
b. A peace officer, when the officer’s duties require the person to carry such weapons.
c. A member of the armed forces of the United States or of the national guard or person in the service of the United States, when the weapons are carried in connection with the person’s duties as such.
d. A correctional officer, when the officer’s duties require, serving under the authority of the Iowa department of corrections.
e. A person who for any lawful purpose carries an unloaded pistol, revolver, or other dangerous weapon inside a closed and fastened container or securely wrapped package which is too large to be concealed on the person.
f. A person who for any lawful purpose carries or transports an unloaded pistol or revolver in a vehicle inside a closed and fastened container or securely wrapped package which is too large to be concealed on the person or inside a cargo or luggage compartment where the pistol or revolver will not be readily accessible to any person riding in the vehicle or common carrier.
g. A person while the person is lawfully engaged in target practice on a range designed for that purpose or while actually engaged in lawful hunting.
h. A person who carries a knife used in hunting or fishing, while actually engaged in lawful hunting or fishing.
i. A person who has in the person’s possession and who displays to a peace officer on demand a valid permit to carry weapons which has been issued to the person, and whose conduct is within the limits of that permit. A person shall not be convicted of a violation of this section if the person produces at the person’s trial a permit to carry weapons which was valid at the time of the alleged offense and which would have brought the person’s conduct within this exception if the permit had been produced at the time of the alleged offense.
j. A law enforcement officer from another state when the officer’s duties require the officer to carry the weapon and the officer is in this state for any of the following reasons:
(1) The extradition or other lawful removal of a prisoner from this state.
(2) Pursuit of a suspect in compliance with chapter 806.
(3) Activities in the capacity of a law enforcement officer with the knowledge and consent of the chief of police of the city or the sheriff of the county in which the activities occur or of the commissioner of public safety.
k. A person engaged in the business of transporting prisoners under a contract with the Iowa department of corrections or a county sheriff, a similar agency from another state, or the federal government.