This is something that varies state to state. Quick search shows that Pennsylvania considers giving up a password as self-incriminating testimony (protected by the 5th amendment), while Massachusetts does not. They can generally force you to use biometrics to unlock or give them a physical key anywhere, however.
This seems to be an actively developing area of law around the world.