Whoever, being a judicial or other public officer or employee, asks or receives any emolument, gratuity, or reward, or any promise thereof, except such as may be authorized by law, for doing any official act, shall be fined not more than $1,000 or imprisoned not more than 5 years, or both.