Solutions of the Helmholtz equation with boundary conditions for force-free magnetic fields