i am not good on this yet but to generate key for ssh you can
http://www.gideonsoftworks.com/SSHHO...H-HOWTO-1.html
http://www.csua.berkeley.edu/ssh-howto.html

and here a little about SSL
http://www.openssl.org/docs/HOWTO/keys.txt