Refusing to answer the questions is a crime. Once you've committed a crime, the examination part can give way to the "You're under arrest" part.
> give way to the "You're under arrest" part.
At least then you get a lawyer, and don't have to say anything, and don't have to give any passwords
Sure, but you're also on video committing the crime in front of police officers. The lawyer isn't going to help you get out of the charge for not answering questions, and if they still want your passwords the judge will absolutely just order you to give them up and keep stacking prison sentences until you comply.