The secretary of state shall, as soon as possible but in any event not later than seventeen days following the primary, canvass and certify the returns of all primary elections as to candidates for statewide offices, United States senators and representatives in Congress, and all legislative and judicial candidates whose district extends beyond the limits of a single county.