You can get the Moodle public key from the admin area > Networking > Settings > Networking > On.
If the public key does not appear, you will have to delete the mnet_localhost_id value in the mdl_config table of your Moodle database so that the mnet environment is forced to renew the environment parameters.
You can do this using the phpMyAdmin tool available in your cPanel. Once in phpMyAdmin, select your Moodle database and browse the table mdl_config. Find the option mnet_localhost_id and delete its value.
Then you can go to your Moodle admin area and check your public key. Please note that once the new public key is activated, the mnet_localhost_id value will be changed. Once this is done, you won't be able to log in to Moodle. To resolve this issue, you should change the mnethostid value for each user in the mdl_user table to match the new value of mnet_localhost_id.
You need help with an application? hostlantern is specialized in hosting and supporting more than 200 scripts. Sign up for our web hosting services and let us help you with your application, 24/7!