We consider a certain class of moment-preserving equations from the point of view of their stationary solutions. Star-Ling from a given stationary distribution, we construct a convex entropy functional which is (in a class of functions with prescribed moments) minimal precisely at this point. Under general assumptions, we show that the entropy which is canonically associated to a stationary distribution is, up to a polynomial change of variables, its Legendre-Fenchel transform. We then show that, if this entropy is extensive, necessarily the stationary distribution is a Gibbs state. Such a state being given by the exponential of the energy density, this clarifies the duality relationship between energy and entropy. (C) 2002 Academie des sciences/Editions scientifiques et medicales Elsevier SAS.