Plus, Camille Cosby's lawyers file an appeal to stop her from being forced to testify against her husband in a pending defamation suit.

With Bill Cosby’s lawyers gearing up for a criminal rape case in Pennsylvania, one simple email could be what helps those charges against him get dropped.

In a 2015 email recently obtained by CNN, Bruce Castor, the former district attorney in Montgomery County, Pennsylvania, wrote his successor Risa Vetri Ferman about a deal he promised Cosby back in 2005 when the star agreed to testify in a civil suit for allegedly raping Andrea Constand.

The deal consisted of ensuring Cosby that if he testified, his deposition couldn’t be used in any criminal matters down the road, “a revelation that could call into question the viability of the [current] criminal case against [Cosby],” CNN wrote.

In the email sent three months before criminal charges were filed against Cosby, Castor wrote:

“I can see no possibility that Cosby’s deposition could be used in a state criminal case, because I would have to testify as to what happened, and the deposition would be subject to suppression.”

He added, “I cannot believe any state court judge would allow that deposition into evidence…Knowing this, unless you can make out a case without that deposition and without anything the deposition led you to, I think Cosby would have an action against the County and maybe even against you personally.”

While Ferman nor Castor have spoken to the media about this matter, the newly voted in district attorney Kevin Steele told CNN that this so-called agreement is potentially null and void saying that, “there is a specific legal method to grant immunity. That was not done in 2005.”

Constand’s lawyer admitted to never knowing about any such deal.

Cosby’s 2005 deposition is the prosecution’s biggest weapon in their case against the star as he admitted under oath that he gave quaaludes to women to have sex with them.

Meanwhile Camille Cosby, Mr. Cosby’s wife of 51 years, has her own legal woes.

This week, lawyers filed an appeal against a judge who is making Mrs. Cosby testify in a Massachusetts defamation case against her husband filed by seven other women who claim they were raped by Mr. Cosby.

Camille Cosby’s lawyers are arguing that by forcing her to testify against her husband it “prohibits a spouse from testifying about private marital conversations in any court proceeding, including depositions,” the Associated Press wrote. However, the original judge ruled that since Mrs. Cosby was also Mr. Cosby’s business manager, she can testify to any behavior that transpired under their business relationship without breaking that rule.