Summary: Possible way to avoid the requirements of giving away the decryption key. Will this work?
Many countries have laws forcing citizens to decrypt their private data if they are being suspected of some illegal activities. If one refuses, he is to be punished.
Now the idea to avoid this. For simplicity the person having private information will be myself.
1. The data stored locally is encrypted.
2. Encryption/decryption key is stored at the remote server controlled by some third party. It can be my lawyer or person/company outside the country's jurisdiction.
3. Regular mode. I authenticate at the remote server, download the key, decrypt my local data, work with it.
4. Emergency mode. I was detained and told by a law enforcement officer or judge to disclose my files. Then I either enter a secret "under pressure" password or my lawyer alerts the third party.
After this the remote server no longer returns me the key. Instead, some agent (person, not software) of the third party monitors the situation and will put the system to the regular mode only after making sure that I am released and all charges dropped.
I honestly tell the police that I don't have the key and describe the scheme.
Question: Will this work?
Related questions about possible loopholes.
Is there any reliable way for a third person to learn if all charges against someone were dropped?
Can I be compelled to contact someone and tell lies?
PS. This is purely theoretical question. Laws may differ by country, any input is appreciated.
Upd. The primary interest is US laws but please feel free to add more details on any other jurisdiction you are have good knowledge of.
And my gratitude for all who contributed so far or will do ater.