throws KeyczarException {
Encrypter keyEncrypter = new Encrypter(
getReader(algorithm, generateParams.get("cryptedKeySet"), generateParams.get("pubKey")));
Signer signer = new Signer(getReader(
generateParams.get("signer"), generateParams.get("cryptedKeySet"), ""));
SignedSessionEncrypter crypter = new SignedSessionEncrypter(keyEncrypter, signer);
String sessionMaterial = crypter.newSession();
byte[] ciphertext = crypter.encrypt(testData.getBytes());
Gson gson = new Gson();
String output = gson.toJson(new SignedSessionOutput(ciphertext, sessionMaterial));
return output.getBytes();
}