Cal. Penal Code § 34005
(a)
(b) Any law enforcement agency that has custody of any firearms, or any parts of any firearms, which are subject to destruction as required by any of the provisions listed in Section 16580, may, in lieu of destroying the weapons, retain and use any of them as may be useful in carrying out the official duties of the agency. Alternatively, upon approval of a court, the agency may do either of the following:
(c)
(d)