void BuildContainer(List <User> listUsers, List <String> listFiles, String archiveName) { String aesKey = Crypt.GenAesKey(); Index idx = new Index(currentUser, aesKey); for (int i = 0; i < listUsers.Count; i++) { idx.AddUser(listUsers[i]); } WriteFile(tmpPath + "index.xml", idx.WriteToString()); Tar t = new Tar(); for (int i = 0; i < listFiles.Count; i++) { t.AddFile(listFiles[i]); } t.Archive(archiveName); Crypt.AESencryptFile(archiveName, Path.GetFileNameWithoutExtension(archiveName) + ".aes", aesKey); //t.ZipFile(archiveName); }
void OpenContainer(String archiveName) { Tar t = new Tar(); if (Path.GetExtension(archiveName) == ".gz") { t.UnZipFile(archiveName); archiveName = Path.GetFileNameWithoutExtension(archiveName); } t.Extract(archiveName); Index idx = new Index(currentUser); List <User> listUsers = idx.ReadToListUser(); }