This should really work with ssh public/private keys¹. Public keys are probably already on the box the git server runs on, and users already have them generated to access git - no need to generate separate gpg keys.
If you have a github account the script could also get the pubkey directly from the github api...
¹http://superuser.com/questions/576506/how-to-use-ssh-rsa-pub...