It works on my shared server when you follow these directions:
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.
Thanks for the help.