The time-integrated CP asymmetry in the Cabibbo-suppressed decay D^{0}→K^{-}K^{+} is measured using proton-proton collision data, corresponding to an integrated luminosity of 5.7 fb^{-1} collected at a center-of-mass energy of 13 TeV with the LHCb detector. The D^{0} mesons are required to originate from promptly produced D^{*+}→D^{0}π^{+} decays, and the charge of the companion pion is used to determine the flavor of the charm meson at production. The time-integrated CP asymmetry is measured …