(a) Section 12025 shall not be construed to prohibit any
citizen of the United States over the age of 18 years who resides or
is temporarily within this state, and who is not within the excepted
classes prescribed by Section 12021 or 12021.1 of this code or
Section 8100 or 8103 of the Welfare and Institutions Code, from
transporting or carrying any pistol, revolver, or other firearm
capable of being concealed upon the person, provided that the
following applies to the firearm:
(1) The firearm is within a motor vehicle and it is locked in the
vehicle's trunk or in a locked container in the vehicle other than
the utility or glove compartment.
(2) The firearm is carried by the person directly to or from any
motor vehicle for any lawful purpose and, while carrying the firearm,
the firearm is contained within a locked container.