You must not enclose the chimney if there is a flue behind it used for burning as this can cause the house to catch fire. When I installed a masonry stove, I had to use the ventilation channel and on that side of the chimney, there was nailed raw paneling, which the chimney sweeper told me I had to tear down. No studs may rest against the chimney either. If there are pipes inside the flue, I believe the requirements are less strict, but check with the chimney sweeper.