The court order is essentially a search warrant for the phone. So from a legal standpoint, certainly they have the authority to do it. It's no different than a search warrant to search their property or their car or bank account information.
Is someone going to argue that they don't have probable cause?![]()
The thornier question is whether Congress can pass a law that requires devices to have a "back door" to any encryption. From a strictly Constitutional standpoint I don't see why not but it would be interesting to see what would happen if they tried - I don't think it would go well for the government for a number of reasons.