Gravitational waves from core-collapse supernovae are produced by the excitation of different oscillation modes in the proto-neutron star (PNS) and its surroundings, including the shock. In this work we study the relationship between the post-bounce oscillation spectrum of the PNS-shock system and the characteristic frequencies observed in gravitational-wave signals from core-collapse simulations. This is a fundamental first step in order to develop a procedure to infer astrophysical parameters of the PNS formed in core-collapse supernovae. Our method combines information from the oscillation spectrum of the PNS, obtained through linear-perturbation analysis in general relativity of a background physical system, with information from the gravitational-wave spectrum of the corresponding non-linear, core-collapse simulation. Using results from the simulation of the collapse of a 35 M presupernova progenitor we show that both types of spectra are indeed related and we are able to identify the modes of oscillation of the PNS, namely g-modes, p-modes, hybrid modes, and standing-accretion-shock-instability (SASI) modes, obtaining a remarkably close correspondence with the time-frequency distribution of the gravitational-wave modes. The analysis presented in this paper provides a proof-of-concept that asteroseismology is indeed possible in the core-collapse scenario, and it may serve as a basis for future work on PNS parameter inference based on gravitational-wave observations.