  We present a new numerical implementation of the general-relativistic
resistive magnetohydrodynamics (MHD) equations within the Whisky code. The
numerical method adopted exploits the properties of implicit-explicit
Runge-Kutta numerical schemes to treat the stiff terms that appear in the
equations for large electrical conductivities. Using tests in one, two, and
three dimensions, we show that our implementation is robust and recovers the
ideal-MHD limit in regimes of very high conductivity. Moreover, the results
illustrate that the code is capable of describing scenarios in a very wide
range of conductivities. In addition to tests in flat spacetime, we report
simulations of magnetized nonrotating relativistic stars, both in the Cowling
approximation and in dynamical spacetimes. Finally, because of its
astrophysical relevance and because it provides a severe testbed for
general-relativistic codes with dynamical electromagnetic fields, we study the
collapse of a nonrotating star to a black hole. We show that also in this case
our results on the quasinormal mode frequencies of the excited electromagnetic
fields in the Schwarzschild background agree with the perturbative studies
within 0.7% and 5.6% for the real and the imaginary part of the l=1 mode
eigenfrequency, respectively. Finally we provide an estimate of the
electromagnetic efficiency of this process.
