Corporations do this all the time, the management gets a written opinion from the legal department and if the company gets caught, they say they thought everything was legal. This is why the law says that not knowing the law doesn't make you innocent - but somehow this never applies to corporations and governments.
Most laws are about intent. If you unintentionally did something you aren't prosecuted.
If you get a ticket for jaywalking, it may help if you can convince the judge that it wasn't your intent to cross the street, for example because you couldn't see the red light. But saying that you didn't knew it was illegal isn't a valid defence, not knowing the law doesn't protect you.
If you accidentally bring a gun into an airport and put it on an xray, you can claim you didn't know it was in your bag and get off.
(post is archived)