ALBANY, N.Y. (AP) — President Donald Trump's frequent criticism of the media and of judges who rule against his policies undermines the public's confidence, New York state's top legal officer said Wednesday amid several state investigations of him or entities linked to him.

Attorney General Letitia James, a Democrat, didn't mention the Republican president's name during a speech she gave at the state Court of Appeals. But afterward, she told reporters that her comments about rhetoric from the federal government were a reference to Trump and his administration.

"Yeah, I didn't want to mention him by name, but it's not only the president, but his administration as a whole," said James, the former New York City public advocate who won the attorney general's race in the November elections.

James' speech at the state's highest court came on Law Day, established in 1958 by President Dwight D. Eisenhower to mark the nation's support of the rule of law. With "Free Speech, Free Press, Free Society" the theme for Law Day 2019, James' speech focused on protecting First Amendment rights.

"A free society living in darkness cannot be free," she said.

The attorney general's office said Wednesday that it's investigating allegations that immigrants who entered the country illegally and worked at his Westchester golf course were bilked out of pay.

James has sued Trump over his charitable foundation and is investigating allegations that Trump exaggerated his wealth to obtain loans.

Last weekend, James' office said that it had launched an investigation into the National Rifle Association and that subpoenas had been issued. During last year's campaign, she vowed to investigate whether the organization deserves its tax-exempt nonprofit status.

The probe started after The New York Times in March and in The New Yorker last month reported about turmoil within the NRA's leadership.

"There were media accounts, we all read it, and we want to make sure that the NRA, and any other charitable organization, that they comply with the not-for-profit law," she told reporters in Albany Wednesday.

New York's investigation into the NRA prompted Trump to tweet Monday that the NRA "is under siege" by James and Democratic Gov. Andrew Cuomo. The president accused them of attempting to "destroy" the gun rights organization using the state's legal system.

More From WIBX 950