  (abridged abstract) Theoretical arguments indicate that close-in terrestial
exoplanets may have weak magnetic fields, especially in the case of planets
more massive than Earth (super-Earths). Planetary magnetic fields, however,
constitute one of the shielding layers that protect the planet against
cosmic-ray particles. In particular, a weak magnetic field results in a high
flux of Galactic cosmic rays that extends to the top of the planetary
atmosphere. We wish to quantify the flux of Galactic cosmic rays to an
exoplanetary atmosphere as a function of the particle energy and of the
planetary magnetic moment. We numerically analyzed the propagation of Galactic
cosmic-ray particles through planetary magnetospheres. We evaluated the
efficiency of magnetospheric shielding as a function of the particle energy (in
the range 16 MeV $\le$ E $\le$ 524 GeV) and as a function of the planetary
magnetic field strength (in the range 0 ${M}_\oplus$ $\le$ {M} $\le$ 10
${M}_\oplus$). Combined with the flux outside the planetary magnetosphere, this
gives the cosmic-ray energy spectrum at the top of the planetary atmosphere as
a function of the planetary magnetic moment. We find that the particle flux to
the planetary atmosphere can be increased by more than three orders of
magnitude in the absence of a protecting magnetic field. For a weakly
magnetized planet (${M}=0.05\,{M}_{\oplus}$), only particles with energies
below 512 MeV are at least partially shielded. For a planet with a magnetic
moment similar to Earth, this limit increases to 32 GeV, whereas for a strongly
magnetized planet ($M=10.0\,{M}_{\oplus}$), partial shielding extends up to 200
GeV. We find that magnetic shielding strongly controls the number of cosmic-ray
particles reaching the planetary atmosphere. The implications of this increased
particle flux are discussed in a companion article.
