  The study of classical spins in topological insulators [Phys. Rev. B {\bf
80}, 115216 (2009)] is generalized to topological superconductors. Based on the
characteristic features of the so-called $F$-function, Bogoliubov-de Gennes
Hamiltonian for superconductors is classified to positive, negative, and zero
"gap" categories for topologically trivial and nontrivial phases of a
topological superconductor as well as a BCS superconductor respectively. It is
found that the $F$-function determines directly the presence or absence of
localized excited states, induced by bulk classical spins and nonmagnetic
impurities, in superconducting gap and their persistence with respect to
impurity strength. Our results provide an alternative way to identify
topologically insulating and superconducting phases in experiments while
without resorting to the surface properties.
