Apple filed court papers on Thursday urging a judge to overturn her order requiring it to unlock an iPhone used by one of the shooters in the San Bernardino attacks.
Forcing Apple to help unlock the phone would set a dangerous precedent that undermines security for all its customers and opens the door to invasive government surveillance, the company argued.
"If Apple can be forced to write code in this case to bypass security features and create new accessibility, what is to stop the government from demanding that Apple write code to turn on the microphone in aid of government surveillance, activate the video camera, surreptitiously record conversations, or turn on location services to track the phone's user? Nothing," the company's lawyers wrote.
Apple made several arguments to back up its position. The All Writs Act, under which the government made its request, does not legally apply in this case, it said. And the order violates Apple's rights under the First and Fifth Amendments of the Constitution, it added.
Prosecutors have argued that the software they want Apple to create will be used only on the one iPhone in this case. The company's lawyers said that's plainly false.
"The government says: 'Just this once' and 'Just this phone,'" Apple's lawyers wrote. "But the government knows those statements are not true; indeed the government has filed multiple other applications for similar orders, some of which are pending in other courts."
"Once the floodgates open, they cannot be closed, and the device security that Apple has worked so tirelessly to achieve will be unwound without so much as a congressional vote."
The All Writs Act is a catch-all law that permits courts to issue an order, or writ, when there's no existing law on the books to cover a particular need.
Apple argued Thursday that there's no law requiring it to unlock the iPhone because Congress has specifically chosen not to pass one. The All Writs Act can't be used to provide law enforcement powers that Congress has elected not to grant, the company said.
Apple strongly supports the efforts of law enforcement, but the government's request is unsupported by the law and would "violate the Constitution," the company said.
"Under well-settled law, computer code is treated as speech within the meaning of the First Amendment," Apple said. Ordering the company to write code to access the phone would amount to "compelled speech and viewpoint discrimination" in violation of its rights.
It would also breach the Fifth Amendment's due process clause by "conscripting a private party" with almost no connection to the crime being investigated to "do the government's bidding in a way that is statutorily unauthorized, highly burdensome, and contrary to the party's core principles."
The FBI has said data on the iPhone could be essential to their ongoing terrorism investigation. The information could help find collaborators of the San Bernardino shooters, they say.
The two sides are due to appear in court March 22 for a hearing in the case.
This fight between Apple and the FBI is shaping up to be a major test case in a year-and-a-half-old argument over whether law enforcement agencies can require device and OS makers to help them defeat encryption and other security measures.