IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
IApiKey key = persistenceManager.newInstance(IApiKey.class);
key.setEmail(email);
// generate a nonce
RandomGUID r = new RandomGUID();
String nonce = "nonce-" + r.toString(); //$NON-NLS-1$
// now use SHA hash on the nonce
String hashKey = HashGenerator.getInstance().encrypt(nonce+email);
// get rid of any chars that might upset a url...