  We study the electronic and transport properties of a topological insulator
nanowire including selective magnetic doping of its surfaces. We use a model
which is appropriate to describe materials like Bi$_2$Se$_3$ within a k.p
approximation and consider nanowires with a rectangular geometry. Within this
model the magnetic doping at the (111) surfaces induces a Zeeman field which
opens a gap at the Dirac cones corresponding to the surface states. For
obtaining the transport properties in a two terminal configuration we use a
recursive Green function method based on a tight-binding model which is
obtained by discretizing the original continuous model. For the case of uniform
magnetization of two opposite nanowire (111) surfaces we show that the
conductance can switch from a quantized value of $e^2/h$ (when the
magnetizations are equal) to a very small value (when they are opposite). We
also analyze the case of non-uniform magnetizations in which the Zeeman field
on the two opposite surfaces change sign at the middle of the wire. For this
case we find that conduction by resonant tunneling through a chiral state bound
at the middle of the wire is possible. The resonant level position can be tuned
by imposing an Aharonov-Bohm flux through the nanowire cross section.
