Relativistic Theory of Pairing in Finite Nuclei