Apple's battle to avoid handing over user data to the US government has taken an unwelcome turn, with the Feds claiming in court that Cupertino's license agreement gives it the right to do what the government tells it.

In a case being heard by US Federal Court magistrate James Orenstein, the government has argued that the Apple end user licence agreement (EULA), which like all licenses tells users “you don't own the software, we do”, bypasses users' rights to protect their information.

The government is asking Apple to bypass the lock screen in compliance with a search warrant in the case, being heard in the US District Court's Eastern District of New York. Apple has already argued its ability to bypass lock screens is limited (here, at Reuters).

The Electronic Frontiers Foundation notes the device in question is an iPhone 5s running iOS 7 – one of the devices that Apple can unlock, so the company tried another tack to fend off the search warrant demanding it cooperate.

Cupertino told the court that forced compliance would “threaten the trust between Apple and its customers and substantially tarnish the Apple brand”.

Since Tim Cook has been working hard to convince users the fruity firm Takes Users' Privacy SeriouslyTM, that argument is probably true – but as the EFF reports, it didn't sway the feds.

Their argument is that since users have no rights under the EULA – except to use the software in ways approved by Apple – “Apple has such a close connection to the devices it sells that it can be compelled to step in and take control of the device”.

“Apple’s software licensing agreement specifies that iOS 7 software is 'licensed, not sold' and that users are merely granted 'a limited non-exclusive license to use the iOS Software'”, the government's brief states, and that means it can be compelled to bypass the lock screen.

That's put Apple on the back foot: it's true that nearly every EULA in the world is based on the vendor's ongoing ownership of every line of code.

The EFF has posted Apple's response here, which reads, in part that the EULA is merely designed to “limitations on the customers’ use and redistribution of Apple’s software”, and that the license agreement shouldn't be read to “conscript” the company “into government service”.

The Register imagines that if the district court disagrees with Apple, this one will run all the way to the United States Supreme Court. ®