this is a child pornography cases where mere possession alone is a crime: what if that wasn't the case? What if this was a murder case and the defendant had stored notes about his murder on the computer?
If someone is asked to decrypt their drive for a murder case, could they then invoke the Fifth Amendment on the basis that they might have child pornography? Can the Fifth Amendment protect you on an unrelated crime that you mention without either admitting to it?
In short, a judge will grant a person legal immunity from prosecution. This removes the fifth amendment argument, as you cannot be prosecuted for the child porn, and you can be compelled to testify.
For example, an accomplice to a crime might be offered immunity -- after which the accomplice cannot refuse to testify under the fifth amendment. Remember, the fifth only guarantees that you will not be compelled to serve as a witness against yourself -- it does NOT grant you the right to remain silent at all times, contrary to popular belief.
How would that work? If I write "I just killed a child" here it doesn't mean I actually did that. Similarly. if I used a decryption key "I am guilty of the murder" then it still does not mean I'm guilty of any murder, just that I have a poor sense of humour and used an odd encryption key.