Say what you want about Apple, but it takes some serious chutzpah to stand up to the US government.
The company has formally opposed an order from a US judge that would help law enforcement unlock an iPhone owned by one of the gunmen responsible for December's mass shooting in San Bernadino, California.
Apple has complied with the authorities in the past, supplying data in its possession when requested and making engineers available to the FBI when needed, but this latest move is a step too far.
Cook's open letter to customers, posted on the Apple website, explains that complying with the order would set a "dangerous precedent" for the future.
The FBI wants us to make a new version of the iPhone operating system, circumventing several important security features, and install it on an iPhone recovered during the investigation. In the wrong hands, this software — which does not exist today — would have the potential to unlock any iPhone in someone’s physical possession.
Apple stopped storing encryption keys with iOS 8, meaning third parties couldn't access users's data. The FBI's response has been to ask for a new version of iOS, that would allow it to unlock the phone electronically and brute-force the password on a locked phone in order to access the files inside.
Cook says the FBI doesn't explicitly ask for a backdoor into Apple's mobile OS, but that's basically what the order wants. He argues there would be no way to guarantee such a backdoor wouldn't be used for nefarious means, or only limited to use in extreme cases.
He also flags up the way the government had made its request, suggesting the All Writs Act could just as easily be used to demand Apple monitors and delivers all your iMessages to the FBI or tracks your location covertly.
If the government can use the All Writs Act to make it easier to unlock your iPhone, it would have the power to reach into anyone’s device to capture their data. The government could extend this breach of privacy and demand that Apple build surveillance software to intercept your messages, access your health records or financial data, track your location, or even access your phone’s microphone or camera without your knowledge.
It's all serious business, and neither Apple nor the FBI is likely to take it lying down. It's not clear where the company goes from here, but it might have to fight its corner in the courts if the government pushes any further.