Rudimentary support for generating keys. Fugly!