Generates one-time passwords in Java