If this happened in an EU country you'd all be wetting yourselves, but for some reason the rooms different today. The professional advice we are given traveling to the US is back up you phone, wipe it, travel and restore once you are comfortable. Sad state of affairs guys
The terrifying line of this for me is: "before and during the search", namely the "before" part. Even if you wiped your device days before, they could always make the argument that you destroyed evidence back then because you were trying to prevent them from searching your device.
In the US, he could have refused to give the pin and that's protected under the 5th Amendment. They would have nothing because they couldn't get into the encrypted phone.
In many countries other then the US like Ireland, they have key disclosure laws which require you to testify against yourself.
In the UK, police can even require key disclosure without a judge.