Any citizen of the United States who, within the jurisdiction thereof, accepts and exercises a commission to serve a foreign prince, state, colony, district, or people, in war, against any prince, state, colony, district, or people, with whom the United States is at peace, shall be fined under this title or imprisoned not more than three years, or both.