  Let $p>3$ and consider a prime power $q=p^h$. We completely characterize
permutation polynomials of $\mathbb{F}_{q^2}$ of the type $f_{a,b}(X) = X(1 +
aX^{q(q-1)} + bX^{2(q-1)}) \in \mathbb{F}_{q^2}[X]$. In particular, using
connections with algebraic curves over finite fields, we show that the already
known sufficient conditions are also necessary.
