The U.S. Department of Justice turned up the heat Friday with a motion to compel Apple Inc. to comply with a court order to unlock the iPhone used by one of the San Bernardino shooters, Syed Rizwan Farook. The order contained some new revelations, including an allegation that Farook,  killed along with wife Tafsheen Malik, may have used that iPhone 5C to contact some of the 14 victims before the shooting.

The order is the latest twist in a legal saga that started earlier this week and could  ultimately end in the U.S. Supreme Court. That court has just eight members after the death of Justice Antonin Scalia, meaning California’s Ninth District would by default be the decider in the event of a tie.

Apple originally had until Tuesday to file its appeal, but it was granted an extension until Feb. 26, giving it a couple more days to prepare its defense, according to unnamed sources speaking to Bloomberg. In preparation for the case, the company on Thursday enlisted the help of Theodore Olson, a First Amendment lawyer, and Ted Boutrous, a constitutional lawyer, according to Reuters.

So the stage is set for a battle both in the court of law and the court of public opinion. There’s a lot of procedure between now and then — as well as the possibility of a settlement. But if and when the arguments unfold, Apple has quite a few avenues to mount its defense.

On one side it can argue that the district court judge who issued the order went too far in the “All Writs Act” order, a catchall rule that dates back to 1789 and allows the court to issue legal orders when no law is on the books. On the other hand, it may also argue that the court had no authority to invoke the act in this case, but that’s if the case makes it to the Ninth District Court of  Appeals.

In its motion, the Department of Justice is pre-emptively pushing back, arguing the “All Writs Act” is necessary to execute a warrant and that it doesn’t place “unreasonable burden” on Apple to develop the backdoor.

Apple is likely to counter the last point on grounds that it doesn’t have a tool developed to get around its own security measures. “The primary question here is centered on the power that the government has to compel a private company to create something that doesn’t exist,” said Aldo Leiva, a data security attorney and partner at Lubell Rosen. “In other words, Apple is not just charted with helping [the government] so to speak, but also creating a new tool strictly for government use, a tool that goes against what Apple’s model is — privacy- focused.”

Muddying the waters, Apple has provided the service in the past for iPhones running iOS 7 and below.

“I don’t think what we’re seeing here is the ‘backdoor’ situation Tim Cook is making this out to be,” said Catherine Lotrionte, director of the Institute for Law, Society and Government at Georgetown University and former general counsel at the Central Intelligence Agency. “This is a specific warrant that Apple has the capability to do already. It would involve FBI handlers visiting an Apple lab, where they can plug in a specific phone into a system like the one they used before."

On the basis of the First Amendment, Apple could also argue that the order is an infringement of free speech, based on the 1999 court case Bernstein vs. U.S. Department of Justice. That case ruled software source code was speech protected by the First Amendment, and the same ruling could be used to argue that Apple’s security code signing methods for iOS fall under that purview.

“The FBI is ordering Apple to sign a piece of code that it wants created involuntarily. Apple signing that code is essentially the computer version of Apple saying not only that this code is genuine, but that it was intended by Apple to run,” Nate Cardozo, attorney for Electronic Frontier Foundation, told Motherboard. “We’ve never seen a compelled speech case that comes close to doing what the government is asking Apple to do here.”

On the Fourth Amendment, the FBI does have a valid search warrant on its side. But it is possible for Apple’s customers to file amicus briefs arguing that if a backdoor tool were to be created, it could expose them as well. The EFF is expected to be one party that files a brief in support of the iPhone maker.

Apple is expected to file the appeal first with the Central California district court judge who issued the court order, U.S. magistrate Sheri Pym. She was appointed to the role in 2011 after serving as a federal prosecutor. Should the judge reject Apple’s appeal, the next course of action would take the case to the Ninth Circuit Court of Appeals.

While it’s not possible to know which judge will get the case until it reaches the court, the ninth circuit has historically leaned towards liberal, free-speech rulings, going back to the 1970s, when President Jimmy Carter appointed three-quarters of its judges, according to the Washington Post.

“I think the civil liberties case is really strong. Tech companies seem to be pretty much united in what they think here,” said Karen Greenberg, director of the Center on National Security at Fordham School of Law. “While it may be overlapping with their business concerns, it overlaps directly with an important principle of privacy.”

This case is being examined so closely by both sides because of its potential to set a precedent for future cases. Tech giants such as Google and Twitter also stepped in to support Apple this week.

“What [both parties] are going to invoke is precedent that points to what new laws need to be understood — both from the privacy point of view and that national security point of view,” Greenberg said. “This conflict was destined to happen.”