I can't remember how.
But I believe I found some code for making diff types of keys on PSC once.