| Devices operating in Internet of Things (IoT) networks may be deployed across vast geographical areas and may be left unguarded. This makes them vulnerable to attacks and motivates operators to check on devices frequently. To this end, we propose and study a resource allocation framework that enables an Unmanned Aerial Vehicle (UAV) to attest devices. A key challenge is optimizing the trajectory of the UAV to ensure it attests as many devices as possible. A trade-off here is that devices are offline while they are checked by the UAV, which affects the amount of data delivered to a gateway. Another challenge is that the UAV is supported by a charging station that experiences time-varying energy arrivals, which in turn affect the operation schedule of the UAV. To address these challenges, we employ a Deep Reinforcement Learning (DRL) solution to optimize the UAV's charging schedule and the selection of devices to be attested during each flight. We also adopt the {\em age of trust} metric to measure the elapsed time since a device was last attested. The simulation results show that after training, our solution reduces the average age of trust by 87\% and throughput loss due to attestation by 30\% as compared to an untrained policy. |