In the US that would be a (search?) warrant which also comes from the judge during a police investigation and authorizes the police to get your phone's passcode under threat of prison time.
This particular case is different because the police did not get a warrant and instead just asked the guy to disclose (without a warrant), which he refused to do, then they tried to use that against the guy in court, which is a violation of the US constitution.