When is it legal to have an unopened liquor container while driving?

It depends on the legislation of the country.