With the primary elections in New York City just six months away, Mayor Bill de Blasio on Wednesday selected the former top lawyer for the City University of New York as the chairman of the city’s Campaign Finance Board.

Frederick P. Schaffer, who retired in December as CUNY’s general counsel and senior vice chancellor for legal affairs, will lead the board, which provides public matching funds to candidates running for office and also penalizes campaigns for financial improprieties.

Mr. Schaffer, 70, has had a long and distinguished career, including stints as a federal prosecutor in Manhattan, as chief litigating corporation counsel under Mayor Edward I. Koch, and as chairman of the Legal Aid Society. But his appointment comes at an awkward time for both the mayor and CUNY, the country’s largest urban public university.

For almost a year, federal prosecutors in Manhattan with the United States attorney’s office for the Southern District of New York have been investigating Mr. de Blasio’s campaign fund-raising to determine whether the mayor or his aides traded favorable city action for donations to his campaign or a now-defunct political nonprofit group.