Weeks after being described by Donald Trump as a “nut job,” James Comey on Thursday deftly recast his confrontation with the president as a clash between the legal principles at the foundation of American democracy, and a venal, self-interested politician who does not recognize, let alone uphold, them.

In sworn testimony before the Senate Intelligence Committee, Mr. Comey, the former F.B.I. director, made clear that he had no confidence in the president’s integrity. Why? “The nature of the person,” he said. Confronted with low presidential character for the first time in his career, Mr. Comey began writing meticulous notes of every conversation with Mr. Trump. “I was honestly concerned that he might lie about the nature of our meeting,” he said.

Mr. Comey said he was stunned during one Oval Office meeting by Mr. Trump’s request — which he very reasonably understood as an order — to drop the F.B.I. investigation into Michael Flynn. Mr. Flynn had been forced to resign as national security adviser the day before, after lying about his contacts with Russia. And Russia, Mr. Comey usefully reminded the senators, had gone to unprecedented lengths to disrupt the 2016 presidential election, using “overwhelming” technological firepower.

“This is about America,” Mr. Comey kept saying. Russia “tried to shape the way we think, we vote, we act — that is a big deal,” he added. “They’re coming after America. ... They want to undermine our credibility in the face of the world.”