I'm not sure that the government can legally force you to lie, though. Anyway, I'm sure the authors of the law didn't consider this possibility (they are politicians after all) so it would ultimately be decided by a judge. I would bet 50/50 on the result.
There's nothing really novel here, though, except a little bit of cryptography to prevent the government from faking the messages, and the authors of the law were almost certainly not politicians. As far as I'm aware, laws are normally drafted by the people who want them passed -- lobbyists, usually, but in this case I would guess the law was written by DOJ or FBI lawyers.