I think your second example makes sense, but I have seen a lot of discussion of the first and the conclusion is mostly that your passwords is not protected then. Basically, you could either enter the password, or you could even give it to the court and the password itself would not be able to be used as evidence.