  In a recent publication we developed a canonical quantization program
describing the gravitational collapse of a spherical dust cloud in 2+1
dimensions with a negative cosmological constant $-\Lambda\equiv -l^{-2}<0$. In
this paper we address the quantization of the Banados--Teitelboim--Zanelli
(BTZ) black hole. We show that the mass function describing the black hole is
made of two pieces, a constant non-vanishing boundary contribution and a
discrete spectrum of the form $\mu_n = \frac{\hbar}{l}(n+ \frac 12)$. The
discrete spectrum is obtained by applying the Wheeler--DeWitt equation with a
particular choice of factor ordering and interpreted as giving the energy
levels of the collapsed matter shells that form the black hole. Treating a
black hole microstate as a particular distribution of shells among the levels,
we determine the canonical entropy of the BTZ black hole. Comparison with the
Bekenstein--Hawking entropy shows that the boundary energy is related to the
central charge of the Virasoro algebra that generates the asymptotic symmetry
group of the three-dimensional anti-de Sitter space AdS$_3$. This gives a
connection between the Wheeler--DeWitt approach and the conformal field theory
approach.
