The making of profit, directly or indirectly, out of state, county, city, town or school district money or other public fund, or using the same for any purpose not authorized by law, by any public officer, shall be deemed a felony, and shall be punished as provided by law.