For some protocols no party should be in the sole possession of the secret key. Rather, during distributed key generation every party obtains a share of the key. A threshold of the participating parties need to cooperate in order to achieve a cryptographic task, such as decrypting a message.
There are different algorithms for different key types. Gennaro et al. introduced a secure protocol for discrete log-based systems in 1999 (online available at citeseer). Boneh and Franklin designed in 1997 a protocol for distributed RSA key generation for three or more parties (online available at Boneh's homepage). In 1999, a paper by Gilboa (online available at Gilboa's homepage) introduced two party distributed RSA key generation. An open source software for this protocol is available at Distrib-RSA Sourceforge Project.