// generate the keys
try {
KeyPair pair = Util.generateKeys();
ElGamalPublicKey publicKey = (ElGamalPublicKey) pair
.getPublic();
ElGamalPrivateKey privateKey = (ElGamalPrivateKey) pair
.getPrivate();
addUser(userId, publicKey, privateKey);
return privateKey;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();