The document Mr. Leonard singled out was an N.S.A. e-mail entitled “What a Success” that was among classified material Thomas A. Drake, a former senior N.S.A. official, was accused of illegally storing at home and disclosing to The Baltimore Sun. Before Mr. Drake’s scheduled trial in June, prosecutors dropped the major charges against him under the Espionage Act. Mr. Drake admitted to a misdemeanor, got no prison time and paid no fine. The judge, Richard D. Bennett of Federal District Court in Maryland, berated prosecutors for how they handled the case.

Mr. Leonard had agreed to testify for the defense without pay as an expert in government classification, saying the e-mail should never have been classified. The N.S.A. declassified the e-mail before trial, but its contents are still protected by court order. Mr. Leonard was allowed to read the e-mail but cannot disclose its contents other than to say it contained no secrets.

“I’ve never seen a more deliberate and willful example of government officials improperly classifying a document,” he said.

Even after the criminal case against Mr. Drake collapsed, Mr. Leonard said, he was outraged by the fact that the document had been classified in the first place and then used as the basis for a felony charge. He petitioned Judge Bennett for permission to use the still-protected e-mail in his complaint to the Information Security Oversight Office, and Judge Bennett agreed to allow that in a court order on Friday.