.getValue("tokenHBEL");
// HBEL Tokens creation
FileSystemUtils.writePrivateFile("json.txt", tokenHBEL);
Executable exec = new Executable("wpes1_linux");
exec.add("h");
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH + "/"
+ aesKeyBEL);
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH
+ "/json.txt");
exec.add(acl);
exec.add(idToken);
exec.add(passphrase);
exec.run();
String jsonout = FileSystemUtils.readPrivateFile("jsonout.txt");
// Put new tokens HBEL in server DB
hasMoreTokens = Boolean.valueOf(client.sendAndWait(
ClientPrimitives.OE_PUT_TOKEN_HBEL, path, userId,
jsonout).getValue("hasMoreTokens"));
FileSystemUtils.deletePrivateFile("jsonout.txt");
}
// End HBEL tokens creation
FileSystemUtils.deletePrivateFiles();
// Update View Informations for added and deleted users
if (!addUser.isEmpty()) {
json = client.sendAndWait(ClientPrimitives.OE_VIEW_INFO, path,
userId, (userId + "-" + addUser), String.valueOf(true))
.getValue("json");
FileSystemUtils.writePrivateFile("json.txt", json);
Executable exec = new Executable("wpes1_linux");
exec.add("addID");
exec.add(folderIdDB);
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH
+ "/json.txt");
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH
+ "/jsonout.txt");
exec.add(passphrase);
exec.add(userId);
exec.run();
jsout = FileSystemUtils.readPrivateFile("jsonout.txt");
client.sendAndWait(ClientPrimitives.OE_SET_VIEW, path, jsout);
FileSystemUtils.deletePrivateFiles();
}
if (!delUser.isEmpty()) {
json = client.sendAndWait(ClientPrimitives.OE_VIEW_INFO, path,
userId, delUser, String.valueOf(true)).getValue("json");
FileSystemUtils.writePrivateFile("json.txt", json);
Executable exec = new Executable("wpes1_linux");
exec.add("remID");
exec.add(folderIdDB);
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH
+ "/json.txt");
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH
+ "/jsonout.txt");
exec.add(passphrase);
exec.run();
jsout = FileSystemUtils.readFile("jsonout.txt");
client.sendAndWait(ClientPrimitives.OE_SET_VIEW, path, jsout);
FileSystemUtils.deletePrivateFiles();
}
// If has SEL level decrypt and re-encrypt at SEL Level
client.sendAndWait(ClientPrimitives.OE_SEL_REQ, path, folderName,
folderIdDB, userId, users, aclSEL,
Boolean.toString(token.hasSEL()));
// Retrieve ViewInformations to encrypt acl to put into server db
String viewInfos = client.sendAndWait(
ClientPrimitives.OE_VIEW_INFO, path, userId, userId,
String.valueOf(true)).getValue("json");
FileSystemUtils.writePrivateFile("viewInfos.txt", viewInfos);
Executable exec = new Executable("wpes1_linux");
exec.add("eACLsel");
exec.add(folderIdDB);
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH
+ "/viewInfos.txt");
exec.add(passphrase);
exec.add("0-" + newSEL);
exec.add(Configuration.LOCAL_PRIVATE_RESOURCES_PATH + "/aclSEL.txt");
exec.run();
String newEncryptedAclSEL = FileSystemUtils
.readPrivateFile("aclSEL.txt");
// SAVE IN .tokens