[...]
(4) An official may provide, allow to be provided or provide access to customs information if the information
(a) will be used solely in or to prepare for criminal proceedings commenced under an Act of Parliament;
(b) will be used solely in or to prepare for any legal proceedings relating to the administration or enforcement of an international agreement relating to trade, this Act, the Customs Tariff, the Special Import Measures Act, any other Act of Parliament or law of a province that provides for the imposition or collection of a tax or duty or Part 2 of the Proceeds of Crime (Money Laundering) and Terrorist Financing Act, before
(i) a court of record, including a court of record in a jurisdiction outside Canada,
(5) An official may provide, allow to be provided or provide access to customs information to the following persons:
(m) any person, if the information is required to comply with a subpoena or warrant issued or an order made by a court of record in Canada;
(n) any person, if the information is required to comply with a subpoena or warrant issued or an order made by a court of record outside of Canada, solely for the purposes of criminal proceedings; and
(11) The person presiding at a legal proceeding relating to the supervision, evaluation or discipline of a specified person may order any measure that is necessary to ensure that customs information is not used or provided to any person for any purpose not relating to that proceeding, including
(d) sealing the records of the proceeding.