Apple's kerfuffle with the Federal Bureau of Investigation and the Justice Department appears far from over. In the company's final brief filed on Tuesday ahead of its March 22 court appearance, lawyers for Apple argued that the government's demands regarding the San Bernardino shooter Syed Farook's encrypted iPhone would "appall" the Founders of our nation. It said the agencies' portrayal of the All Writs Act, a 200-year-old statute that gives courts substantial autonomy in issues of law enforcement, as an "all-powerful magic wand" was an attempt to "rewrite [the] history" of the statute, and said that the FBI was violating the rights of Apple engineers by proposing they spend "weeks" in a "super-secure facility" on behalf of the agency. And it further accused investigators of infringing on Apple's right to due process of law by forcing it "on a mission that is contrary to [its] values."

It's the most recent rebuttal of the U.S. government in a case with far-reaching implications for electronic security. At stake is investigators' authority to force private tech companies to implement a "backdoor" in secured devices and services. In February, a California court granted the FBI an order to force Apple to rewrite the iPhone's operating system in order to bypass Farook's passcode, an order which if upheld could set a "dangerous precedent," Apple CEO Tim Cook has said. The FBI maintains that the scope of the order is limited to a single iPhone and that it poses no threat to Apple's or any other company's encryption policies.

Related: FBI: Crucial iCloud settings on San Bernardino shooter’s iPhone are disabled

In Tuesday's filing, Apple attacked the legal foundations of the government's case. Lawyers for the company argued that forcing engineers to rewrite the iPhone's operating system constituted both an overstepping of the investigators' constitutional bounds and a violation of the company's free speech rights. "[The] [w]riting of code requires a choice of (1) language, (2), audience, and (3) syntax and vocabulary, as well as the creation of (4) data structures, (5) algorithms to manipulate and transform data, (6) detailed textual descriptions explaining what code is doing, and (7) methods of communicating information."

In addition, Apple posits that the 1996 Communications Assistance for Law Enforcement Act (CALEA) exempts Apple and other "electronic communication service providers" from having the government "[dictate] … any specific equipment design or software configuration."

At a press conference on Tuesday, Apple's legal team characterized the arguments of the FBI and Justice Department as "reckless" and "uninformed." It called the government's recent assertion that it might have the authority to seek the iPhone operating system's source code and signing key -- tools which would grant law enforcement the ability to unlock virtually any iPhone -- "catastrophic." And it pointed to the government's shifting narrative regarding the iPhone's iCloud password as evidence of a shaky legal foundation.

Farook's account underwent a reset by San Bernardino officials at the request of the FBI, a decision that Apple maintains precluded any possibility of extracting the agency's sought-after data from an iCloud backup rather than the phone itself. The last backup was performed on Oct. 19, roughly six weeks prior to the Dec. 2 terrorist attack on a regional center which left 14 dead and 22 injured.

Related: Department of Justice threatens to take Apple’s iOS source code in San Bernardino case

"The Justice Department's shifting, contradictory positions on the issue -- first blaming the passcode change on the County, then admitting that the FBI told the County to change the passcode … and now trying to justify the decision in the face of Director Comey's admission that it was a mistake -- discredits any notion that the government properly exhausted all viable investigative alternatives before seeking this extraordinary order from this court," lawyers for Apple said.

The Justice Department and FBI, meanwhile, have called Apple's arguments "desperate" and "misleading." In a February court motion, the Justice Department blamed the company's reluctance to assist with the investigation on "a perceived negative impact on its reputation." Apple has vehemently denied that accusation. "Of [all of Apple's] advertisements, not a single one has ever advertised or promoted the ability of Apple's software to block law enforcement requests to the contents of Apple devices," Apple senior director Robert Ferrini said in a sworn statement.

Related: Boost for Apple as NY judge rules tech firm doesn’t have to unlock iPhone for FBI

The government's persistence may push Apple to implement stricter encryption mechanisms in the future. According to the Wall Street Journal, the company's working to beef up its iCloud security so that it won't be able to decrypt backups of iPhone data. Under a legal precedent known as the third-party doctrine, companies such as Apple that store user data are subject to legal requests for that data. Encryption wouldn't exempt the company from purview, but would make the data essentially unusable.

The dispute between Apple and the investigators has drawn support on both sides. Tech companies, human rights groups, privacy advocates, and the United Nations have expressed support for Apple. Law enforcement and government officials, meanwhile, have largely sided with Justice Department and the FBI In a recent speech at SXSW in Austin, Texas, President Obama emphasized the need to strike a balance between "safety" and "security."