Virial masses of galactic halos from galaxy-galaxy lensing : theoretical modeling and application to SDSS