  Let n be a square-free polynomial over F_q, where q is an odd prime power. In
this paper, we determine which irreducible polynomials p in F_q[x] can be
represented in the form X^2+nY^2 with X, Y in F_q[x]. We restrict ourselves to
the case where X^2+nY^2 is anisotropic at infinity. As in the classical case
over Z, the representability of p by the quadratic form X^2+nY^2 is governed by
conditions coming from class field theory. A necessary (and almost sufficient)
condition is that the ideal generated by p splits completely in the Hilbert
class field H of K = F_q(x,sqrt{-n}) (for the appropriate notion of Hilbert
class field in this context). In order to get explicit conditions for p to be
of the form X^2+nY^2, we use the theory of sgn-normalized rank-one Drinfeld
modules. We present an algorithm to construct a generating polynomial for H/K.
This algorithm generalizes to all situations an algorithm of D.S. Dummit and
D.Hayes for the case where -n is monic of odd degree.
