public override void Perform(object o, IExplorer explorer) { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "*.cmp|*.cmp"; if (dialog.ShowDialog() == DialogResult.OK) { SquadronHelper.Instance.StartAnimation(); SquadronContext.WriteMessage("Starting Export to file(s): " + dialog.FileName); try { ImportExportUtility utility = new ImportExportUtility(); if (utility.Export(o as SPWeb, dialog.FileName)) { string message = "Exported succesfully!" + Environment.NewLine + Environment.NewLine + "Following are the files:" + Environment.NewLine; foreach (string file in Directory.GetFiles(Helper.Instance.ExtractFolder(dialog.FileName), Helper.Instance.ExtractFileName(dialog.FileName).Replace(".cmp", "*.cmp"))) { message += file + Environment.NewLine; } SquadronContext.Info(message); } } finally { SquadronHelper.Instance.StopAnimation(); } } }
public void CannotReimportWithEmptyPassphrase() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, "foo"); utility.Import(keyFileName, ""); }
public void CanDetermineThatKeyFileIsPasswordProtected() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, "foo"); Assert.IsTrue(utility.IsPasswordProtected(keyFileName)); }
private bool ExportWeb(SPWeb source) { _tempfolder = Helper.Instance.GetExecutionFolder() + "\\" + Guid.NewGuid().ToString(); _exportpath = _tempfolder + "\\export.cmp"; ImportExportUtility utility = new ImportExportUtility(); bool result = utility.Export(source, _exportpath); return(result); }
public void CanDetermineThatKeyFileIsNotPasswordProtected() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, ""); Assert.IsFalse(utility.IsPasswordProtected(keyFileName)); }
public void CannotReimportWithEmptyPassphrase() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, "foo"); utility.Import(keyFileName, ""); }
public void CanExportAndReimportTextWithNoPassphrase() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, ""); byte[] returnedKey = utility.Import(keyFileName, ""); ArraysEqual(key, returnedKey); }
public void CanReimportWithCorrectPassphrase() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, "foo"); byte[] returnedKey = utility.Import(keyFileName, "foo"); ArraysEqual(key, returnedKey); }
public void CanExportAndReimportTextWithNoPassphrase() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, ""); byte[] returnedKey = utility.Import(keyFileName, ""); ArraysEqual(key, returnedKey); }
public void CanReimportWithCorrectPassphrase() { byte[] key = GenerateKey(); ImportExportUtility utility = new ImportExportUtility(); utility.Export(key, keyFileName, "foo"); byte[] returnedKey = utility.Import(keyFileName, "foo"); ArraysEqual(key, returnedKey); }