When it comes to defending yourself against sex offenses, one of the strategies you may use is to fight the evidence against you. It is important to go over all evidence and find out how the prosecution obtained it, handled it and intends to use it.
If you discover there are questions about how the prosecution obtained evidence, you may be able to have the court throw it out by citing the exclusionary rule.
The Legal Information Institute explains the exclusionary rule requires the court to dismiss evidence collected in a way that violates your constitutional rights. It applies mainly in criminal cases. This applies also to evidence found from evidence obtained illegally even if the evidence itself was legally obtained.
For example, officers discover one piece of evidence through an illegal search. This evidence leads them to find more evidence, which they do secure a search warrant to find. All evidence found in this situation would fall under the exclusionary rule.
Common examples of evidence that ends up unusable due to the exclusionary rule would be anything gathered from someone under arrest who did not receive their Miranda Rights, information gathered from someone in custody who officers refused to allow legal representation and evidence obtained during an illegal search.
One of the exceptions to the exclusionary rule is the good-faith exception. This says that if officers gather evidence under a seemingly valid search warrant that later turns out to be invalid, that evidence is still admissible in court. The reasoning is there was no malicious intent to violate rights and excluding the evidence would do little to prevent the incident from occurring again.
There are other exceptions to this rule, but in general, if during the collection of evidence, officers violate your constitutional rights, the prosecution cannot use that evidence in court against you.