It's a very interesting problem .... But before doing any implementation it may be a good thing that you choose which public-private key scheme you will use for your problem.
Maybe these links may help you:
http://en.wikipedia.org/wiki/X.509
http://en.wikipedia.org/wiki/Digital_Signature
http://en.wikipedia.org/wiki/Digital_Certificate
openssl
hope that helps ... good luck! :)
perl -Te 'print map { chr((ord)-((10,20,2,7)[$i++])) } split //,"turo"'