Change generateKey to not take callback. Closes #2151. Closes #2148