Christopher A. Wray is sworn in Wednesday for his Senate confirmation hearing. (Jahi Chikwendiu/The Washington Post)

More than two months after President Trump fired FBI director James B. Comey, Congress is very carefully, very warily considering his replacement.

The person Trump picked to replace Comey, former Justice Department official Christopher A. Wray, could be taking over an intelligence agency that has been simultaneously investigating the president and attacked by him.

Wray's task Wednesday was to convince the Senate Judiciary Committee, which will vote to send his nomination to the full Senate for approval, that he would rather get fired than bend to political pressure. And he attempted to do just that. Here are five key takeaways from the hearing:

1. Trump could fire Wray, too. 

At least one powerful Republican laid the groundwork for the president to do just that. In his opening statement, Senate Judiciary Chairman Charles E. Grassley (R-Iowa) reminded everyone that, yes, FBI directors are approved by the Senate to serve for 10 years, but the president has unilateral authority to fire them at any time.

“The FBI has a 10-year term limit, and no restrictions on any president to fire any director,” Grassley said. " … The term limit is a ceiling, not a floor, and while independence from partisanship is critical … history shows a 10-year term limit isn't there to protect the FBI from politicians or politics, it's to help protect the FBI director from overreaching or abusing power.”

Wray added that he thinks an FBI director should be fired if she or he engages in misconduct in response to a question from Sen. Ben Sasse (R-Neb.).

2. Wray said he'd probably resign first if things got really sticky

Sen. Patrick Leahy (D-Vt.) asked FBI director nominee Christopher Wray on July 12 what he would do if the president asked him to do something unethical or unlawful. "I would try to talk him out of it, and if that failed I would resign," he said. (Reuters)

Trump's firing of Comey because of “this Russia thing” spooked members of Congress.

So Democrats and some Republicans were almost singularly focused on drawing commitment from Wray that he would push back against political pressure on the FBI.

“The FBI is one of the most powerful tools available to the president, and from what we've seen from the White House, they may be expecting your loyalty as the president did with Director Comey,” said Sen. Patrick J. Leahy (D-Vt.).

Wray appeared to say all the right things about independence. He said he's never been asked, nor would he give, the president a loyalty pledge, as Trump allegedly asked Comey for.

Wray had some flashy lines to underscore this: “Anybody who thinks that I would be pulling punches as the FBI director sure doesn't know me very well.”

And, perhaps most importantly, he said he'd resign if asked by the president to do anything “illegal, unconstitutional or even morally repugnant.” He specifically drew the line on Trump trying to interfere with special counsel Robert S. Mueller III's investigation into Russian meddling and the president's alleged attempts to obstruct justice. Wray also said he didn't know whether the president had the authority to fire Mueller.

Christopher Wray, President Trump's nominee to lead the FBI, said he would support special counsel Robert Mueller's investigation on July 12. "I view him as the consummate straight shooter," he said, "I would be pleased to do what I can to support him in his mission." (Reuters)

3. Wray and Trump are polar opposites on some big issues

Trump thinks torture works; Wray thinks torture is “wrong” and “ineffective.”

Trump thinks the investigation into him and his presidential campaign is “the greatest Witch Hunt of a politician in American history. Sad!” Wray said he does “not consider Director Mueller to be on a witch hunt.”

Trump's allies have tried to discredit Mueller as Trump has toyed with firing him; Wray says Mueller is a “consummate straight shooter.”

Trump won't say whether Russia alone meddled in the U.S. election; Wray says he has “no reason whatsoever to doubt the assessment of the intelligence community” that Russia did meddle.

Trump thinks Comey was a “nut job;” Wray doesn't: “In all my dealing with Jim Comey, he was a terrific lawyer, a dedicated public servant and a wonderful colleague.”

Trump shared highly classified information with Russians; Wray says it'd be extremely dangerous to share classified information that could put U.S. sources abroad at risk.

4. Wray thinks the Trump administration should have handled its Russia interactions differently

Sen. Linsday Graham (R-S.C.) questioned FBI director nominee Christopher Wray about the recent news surrounding Donald Trump Jr. on July 12, and criticized the president's son for not calling the FBI. (Reuters)

Wray wouldn't comment specifically on news that Donald Trump Jr. met with a Russian lawyer to get dirt on Hillary Clinton.

But he did underscore that it was probably not a good idea by saying two things in particular:

First, “Russia is a foreign nation that we have to deal with very warily.”

And, that any politician who gets approached by Russia (or Ukraine) about their election shouldn't take the meeting. Legal red flags should go up, and they should call the FBI. “Any threat or any effort to interfere in our election from any nation state or nonstate actor is the kind of thing the FBI would want to know,” Wray said.

5. It doesn't look like he'll have a problem getting confirmed.

A couple hours into the hearing, a key Democrat, Sen. Al Franken (Minn.), said what seemed even the most skeptical Democrats were thinking: Wray passed the test. “I think you had a good hearing today, and I wish you luck.”