A rational approach towards the design of chitosan-based nanoparticles obtained by ionotropic gelation.