Whoever intentionally and without lawful right thereto, exercises a function of a public office or, having held such office and the right thereto having ceased, refuses to surrender the office or its seal, books, papers, or other incidents to a successor or other authority entitled thereto may be sentenced to imprisonment for not more than 364 days or to payment of a fine of not more than $3,000, or both.