(3) It shall not be an offense under this section if:
[...]
(d) The person, at the time of carrying a concealed weapon, held a valid written permit to carry a concealed weapon issued pursuant to
section 18-12-105.1, as said section existed prior to its repeal; except that it shall be an offense under this section if the person was carrying a concealed handgun in violation of the provisions of
section 18-12-214 (3); or
(d.5) The weapon involved was a handgun and the person held a valid permit to carry a concealed handgun or a temporary emergency permit issued pursuant to part 2 of this article; except that it shall be an offense under this section if the person was carrying a concealed handgun in violation of the provisions of
section 18-12-214 (3); or
(e) The person is a school resource officer, as defined in
section 22-32-109.1 (1) (g.5), C.R.S., or a peace officer, as described in
section 16-2.5-101, C.R.S., when carrying a weapon in conformance with the policy of the employing agency as provided in
section 16-2.5-101 (2), C.R.S.