This is related to another recent question, where someone asked what are the consequences of committing copyright infringement when your boss tells you to do so.
A slighlty different case: Your boss asks you to do something that you think might be illegal, but you are not sure about it. You talk to your boss, he says he checked with his legal department and it's fine, and he even gives you this information in writing.
You do what your boss asks you to do. And it is indeed something where the average person wouldn't know for sure if it's legal or not. Problem is: The action was indeed illegal. What are the consequences for you if this is found out, given that you relied on a written statement from your boss that it is legal?