Apple argued in a federal district court Monday why the company should not be forced to unlock and decrypt an iPhone for New York law enforcement under an 18th-century law already skepticized by the presiding judge.

In its latest filing to the U.S. District Court for the Eastern District of New York late last week, Apple took a tough stance against federal prosecutors, who argue the company should be compelled to unlock and decrypt a suspect’s iPhone in a Brooklyn felony drug charge case under the All Writs Act — a 1789 statute intended to fill in gaps in legal authority where no preexisting statute applies.

Despite the All Writs Act having been used to compel the unlocking of at least three iPhones in the past for the FBI, Apple is arguing that precedent only exists because no federal court has ever challenged its legitimacy.

“Apple agrees with the court’s preliminary conclusion that the All Writs Act should not be read to permit the relief the government requests,” the Cupertino-based company wrote in its latest court filing. “This case is not an instance where ‘the government seeks to fill in a statutory gap that Congress has failed to consider,’ but rather one where the government ‘seeks to have the court give it authority that Congress chose not to confer.'”

Apple further argued the Communications Assistance for Law Enforcement Act already set the legal boundaries for phone surveillance, and that the government can’t “compel a private company like Apple to be conscripted as an agent of the government into performing forensic services on a device in the government’s possession for the benefit of its case against an individual citizen.”

“The situation would be no different than if the government sought to use the All Writs Act to force a safe manufacturer to travel around the country unlocking safes that the government wants to access, or to make a lock manufacturer pick locks for the government,” Apple wrote.

After reviewing the government’s request, Magistrate Judge James Orenstein ordered Apple to provide a briefing to the court on the technical feasibility of complying with the government’s request, and whether or not it would be “burdensome” — criteria allowing for the dismissal of prosecutorial requests under the 200-plus year old law.

In his order Orenstein, who previously challenged another government All Writs Order in 2005, suggested he would not issue the order at the government’s request, but wanted an explanation from the iPhone maker on why the request would be “unduly burdensome” first.

Apple explained in a subsequent filing that while the specific request itself wouldn’t be technically burdensome (the iPhone in question is a 5s running iOS 7, and Apple didn’t adopt default, full end-to-end encryption until iOS 8), the scale of it would be, if the case established precedent and Apple were forced to divert personnel, software and hardware resources from its daily business activities for every request.

The Silicon Valley giant further argued that to comply with the government’s order without a strong legal basis, as opposed to a “gap-filling statute,” would harm the company’s reputation and established consumer trust. As such, the All Writs Act request “imposes a real burden on Apple—commercial and reputational,” the company concluded.

Apple made significant reputational gains a little over a year ago when CEO Tim Cook announced default end-to-end encryption for all users upgrading to iOS 8, a move he explained the company made specifically to protect users’ data from law enforcement and intelligence agency probes in the wake of the Snowden disclosures. As a result, Cook explained, it’s technically impossible for even Apple to access users’ data.

“We said no backdoor is a must,” Cook said at a Wall Street Journal tech conference last week. “Do we want our nation to be secure? Of course. No one should have to decide between privacy or security. We should be smart enough to do both. Both of these things are essentially part of the Constitution.”

The iPhone maker’s stance landed it in hot water with FBI Director James Comey, who has pushed Congress for the last year to step in and compel Apple and others to facilitate a way for law enforcement to access suspects’ data. The White House recently stepped back from advocating for legislation mandating “backdoors” into encryption, which Comey told lawmakers in Congress last week was only a temporary stance because there’s no clear picture yet on what a legislative solution would be.

In the meantime, the FBI director said, the agency will “continue the conversations we’re having with the private sector, with allies around the world and with state and local law enforcement” to find a solution.

RELATED: The FBI is Losing the Fight Against Encryption

“I’ve heard from a lot of folks that it’s too hard, and my reaction to that is, really?” Comey said during a previous hearing. “Have we really tried? When I look at the industry today, I see companies — I’m not going to name them here — major Internet service providers who are able to comply with court orders, because they strongly encrypt in transit, and they decrypt when it crosses their networks so they can read our emails so they can send us ads.”

“I’ve never heard anybody say those companies are fundamentally insecure and fatally flawed from a security perspective.”

Follow Giuseppe on Twitter