While there exist some narrow defences, such as the “public good” defence [CCC s. s. 163.1 (6)] which allow for the depiction of minors in sexual acts in certain narrow circumstances [e.g. for scientific, educational, or medical use], these exceptions are complex and legally nuanced.
If you are considering making, possessing, accessing, or transmitting any material which you believe may fall under an exception to Canada’s child pornography laws, you should seek legal advice right away. Without cautious legal guidance, these exceptions are dangerous minefields where a mistake in your understanding of the rules can cause significant legal jeopardy.