After the expiration of the minimum period of rehabilitation a person who has complied with the requirements of Section 4852.05 may file in the superior court of the county in which he or she then resides or in which he or she was convicted of a felony or of a crime the accusatory pleading of which was dismissed pursuant to Section 1203.4, a petition for ascertainment and declaration of the fact of his or her rehabilitation and of matters incident thereto, and for a certificate of rehabilitation under this chapter. A petition shall not be filed until and unless the petitioner has continuously resided in this state, after leaving prison or jail, for a period of not less than five years immediately preceding the date of filing the petition.
Ca. Pen. Code § 4852.06