When President Donald Trump appointed Atlanta lawyer Christopher Wray to succeed James Comey as the director of the FBI, my initial reaction was not positive. Wray is a veteran of the Department of Justice and is part of that good-old-boy DOJ network that knows how to protect its own. Indeed, when then-New Jersey Gov. Chris Christie, a former U.S. attorney, needed a good criminal defense lawyer -- whose millions in fees were paid by New Jersey taxpayers -- he hired Wray.

Christie was never indicted in the Bridgegate scandal, but defense counsel for those who were sought Christie's cellphone to demonstrate to jurors the governor's involvement in the plot to shut down lanes near the George Washington Bridge for political retaliation. Christie claimed that he gave his phone to federal prosecutors, but they told the court that they did not have the phone. Where was it? In a safe of the Atlanta law firm that employed Wray.

The FBI director-to-be, sitting in his office in Atlanta, failed to provide evidence he had that he knew a federal court in Newark was seeking. This sordid episode was not dwelled upon during Wray's confirmation hearings, at the end of which he was confirmed to a 10-year term running the FBI. So Trump's search for an outsider who would change the Comey-led culture of political justice and run the nation's premier law enforcement agency according to the rule of law turned up the ultimate insider.

Earlier this week, Wray testified before the Senate Judiciary Committee on the behavior of FBI agents -- including the former director and former deputy director -- during the criminal investigation of former Secretary of State Hillary Clinton. Wray had to thread a small needle.

On the one hand, the FBI is an investigative entity only. It does not decide whom or what to charge; it merely reports its findings to federal prosecutors in conjunction with their presentation of evidence to grand juries. As such, the FBI is subject to the DOJ prosecutors for whom it works, and the DOJ, of course, works for the president.

On the other hand, because both the DOJ and the FBI are guided by the ethical rules that govern lawyers and by the values of the rule of law implicit in American culture and recognized by the courts, the DOJ enjoys some independence from the president, and the FBI enjoys some independence from the DOJ. Principles such as equal protection under the law and due process of law protect life, liberty and property and trump instructions of the president to the DOJ and instructions of the DOJ to the FBI. Stated differently, the FBI must go where the evidence of crime leads it, and the DOJ must prosecute when the evidence is lawfully sufficient, no matter the subject.

This obviously becomes complex and treacherous when the president is the subject of the FBI's investigation, because one of the rule-of-law principles is that no one can be the judge or prosecutor in his own case. And it was in that context that Director Wray testified earlier this week. His testimony was largely about the response of the present-day FBI to the political excesses of the Comey-led FBI as articulated in a 568-page report issued by the inspector general of the DOJ.

That report found that there was political bias at the FBI and the DOJ in favor of Clinton while she was the subject of a criminal investigation and that there was political prejudice against Trump at the same time. But it also found that the bias and prejudice were not the deciding factors in the ill-advised decision by Comey to announce that Clinton would not be charged and then to recount all the damning evidence the FBI had amassed against her or in his decision to reopen and then reclose the investigation.

In Wray's testimony, I detected not a political defense of the FBI but rather a careful assessment of the constitutional relationship between Congress and the FBI that demonstrated a grasp of nuance and a defense of the rule of law.

Wray has been battling the House Intelligence Committee over its demands to get a peek at a portion of special counsel Robert Mueller's files on the president. The committee has threatened Wray and his boss, Deputy Attorney General Rod Rosenstein, with censure, contempt and even impeachment if Wray fails to deliver the files. Wray's message to the committee, uttered in his Senate testimony, was that the FBI will follow the law and not surrender privileged information.

A privilege is the ability of the entity that enjoys it to prevent the revelation of information that the privilege covers. The attorney-client and priest-penitent privileges, for example, permit the client or the penitent to prevent the lawyer or the priest from revealing their communications. Wray knows that law enforcement, too, enjoys privileges, such as the obligation to keep matters that have been presented to a grand jury, the thoughts and impressions and strategies of investigators and prosecutors, and information developed from confidential sources secret.

By signaling that he will honor those privileges in the investigation of President Trump, Wray is upholding the rule of law. Were he not to do this, he'd be spilling the contents of a criminal file to the political allies of the subject of the file -- a spill that the law would not condone because it would put the president above the law.

In defending these rule-of-law privileges, Director Wray is upholding the independence of the FBI against an unforgiving political onslaught orchestrated by the president's allies. I hope this is resolved in a court of law and not in the court of public opinion. Public opinion is a reed that moves with the wind. The rule of law is a rock that keeps us free.