Every officer whose office is abolished by law, or who, after the expiration of the time for which he may be appointed or elected, or after he has resigned or been legally removed from office, willfully and unlawfully
(a)
Mutilates, destroys, or takes away the records, papers, documents, or other writings appertaining or belonging to his office, or
(b)
Withholds or detains from his successor, or other person entitled thereto, the records, papers, documents, or other writings appertaining or belonging to his office, or any money or property in his custody as such officer,
is punishable by imprisonment in the state prison.