We solve the inhomogeneous Ornstein-Zernike equation for the pair correlation functions together with the Lovett-Mou-Buff-Wertheim equation for the density profiles for charged hard spheres in the vicinity of a charged hard wall. This constitutes the so-called primitive model of the electric double layer. In this article, we consider 2-1 electrolytes (doubly charged positive ions and singly charged negative ions) near both positively and negatively charged surfaces. We use the hypernetted chain approximation to close the Ornstein-Zernike equation. Except for very high surface charge densities and low bulk concentrations, we obtain excellent agreement with the Monte Carlo data. © 1989 American Institute of Physics.