Remember the 5th Amendment applies to passwords. No law enforcement officer may EVER compel you to log in to a device with a password / pass code / unlock pattern, for any reason.
This is the way things should work. But, there was a widely reported case recently where a man accused of possessing child pornography has been held in jail for a long time [0]. From what I can tell, he's been in jail for contempt of court for nearly 2 and a half years! [0] https://arstechnica.com/tech-policy/2017/03/man-jailed-indef...
How about this theoretical situation: I place an encrypted file in a hard drive belonging to someone I dislike, and then frame them circumstantially with the likely possession of contraband data on said hard drive. Since he owns the device, he may be so unlucky as to have the authorities believe he knows how to decrypt the file despite him claiming he has no knowledge of how the file came to be or how to decrypt it. If they will not accept that argument, this seems like a good way to place a political opponent in jail indefinitely by someone with the means to craft such a scenario