In a new brief in its ongoing legal battle with the FBI and Department of Justice, Apple said that the government does not have any legal authority to force the company to create a backdoored version of iOS and that the FBI has “belittled” Apple’s concerns about the danger of creating such software.

In the new document, Apple’s attorneys focus much of their attention on the government’s use of the ancient All Writs Act to support its assertion that Apple should be compelled to create the compromised software and help the FBI install it on the iPhone used by Syed Farook. Apple’s brief argues that the act does not give the government the authority to demand this assistance from the company and is being misused in this case.

“The All Writs Act cannot be stretched to fit this case because to do so ‘would be to usurp the legislative function and to improperly extend the limited federal court jurisdiction.’ The government attempts to rewrite history by portraying the Act as an all-powerful magic wand rather than the limited procedural tool it is.” the brief says.

“As theorized by the government, the Act can authorize any and all relief except in two situations: (1) where Congress enacts a specific statute prohibiting the precise action (i.e., says a court may not ‘order a smartphone manufacturer to remove barriers to accessing stored data on a particular smartphone,’), or (2) where the government seeks to ‘arbitrarily dragoon[]’ or ‘forcibly deputize[]’ ‘random citizens’ off the street. Thus, according to the government, short of kidnapping or breaking an express law, the courts can order private parties to do virtually anything the Justice Department and FBI can dream up. The Founders would be appalled.”

“Apple prioritizes the security and privacy of its users.”

Apple’s brief is a direct response to one filed by the federal government last week. In that document, the government’s lawyers said that Apple’s refusal to help the FBI bypass the security features in iOS was a marketing ploy and asserted that it could demand the company’s source code and master signing key if it so desired.

“For the reasons discussed above, the FBI cannot itself modify the software on Farook’s iPhone without access to the source code and Apple’s private electronic signature. The government did not seek to compel Apple to turn those over because it believed such a request would be less palatable to Apple. If Apple would prefer that course, however, that may provide an alternative that requires less labor by Apple programmers,” the government’s motion says.

Apple does not address that threat directly in its brief, but says instead that the government’s claims that the company is motivated by marketing and brand protection are insulting and baseless.

“The government seeks to commandeer Apple to design, create, test, and validate a new operating system that does not exist, and that Apple believes—with overwhelming support from the technology community and security experts—is too dangerous to create,” Apple’s brief says. “Seeking to belittle this widely accepted policy position, the government grossly mischaracterizes Apple’s objection to the requested Order as a concern that ‘compliance will tarnish its brand’, a mischaracterization that both the FBI Director and the courts have flatly rejected.”

The crux of the matter, Apple’s brief says, is that the company has spent the last several years improving the security of iOS and hardening it against attack. What the FBI is asking the company to do would undo that work, Apple says.

“As Apple explained in its Motion, Apple prioritizes the security and privacy of its users, and that priority is reflected in Apple’s increasingly secure operating systems, in which Apple has chosen not to create a back door. Compelling Apple to reverse that choice is ‘offensive to it’,” the brief says.