This letter studies the secrecy communication in a wireless-powered sensor network, where the access point (AP) first sends an energy signal to power the sensor node (S) and jammer (J) and, then, J exploits the harvested energy to send a jamming signal to interfere with the eavesdropper, in order to protect the uplink communication from S to the AP. Specifically, assuming that all the channels are subjected to Nakagami-m fading, we derive a closed-form expression of the exact secrecy outage probability (SOP). Furthermore, by exploiting the results about the approximations to the statistics of products of independent random variables, we provide approximate and asymptotic expressions of the SOP, and the latter enables us to obtain the secrecy diversity order (SDO), observe the impact of several parameters on the SOP, and provide a closed-form expression for the time switching (TS) ratio, which maximizes the secrecy throughput. Simulations present the accuracy of the derived SOP and SDO, the tightness of the approximation, and the effectiveness of the obtained TS ratio.