private void UpdateTaskInfo() { PreKeyring.FileInfo_Update ( new SecuruStik.DB.FileMetaData { FileName = Path.GetFileName(VelostiScsi.CurrentTask.PlaintextFilePath), FilePath = VelostiScsi.CurrentTask.PlaintextFilePath, Key = VelostiScsi.CurrentTask.Key, PlainTextHash = VelostiScsi.CurrentTask.HashValueOfPlaintext, CryptTextHash = VelostiScsi.CurrentTask.HashValueOfCryptotext } ); }
public Boolean DownloadSharingFile(Protocal.SharingInfo si) { String copyRef = si.Reference; String fileName = si.FileName; try { String dropboxPath = BaseExtension.FileStringHelper.GetNonConflictFileName(Path.Combine(DropBoxController.DropBox_DownloadFolder, fileName)); UserKey uk = PreKeyring.UserKey; PRE_KEY userKey = new PRE_KEY(); userKey.PK.PK1 = uk.PK1; userKey.PK.PK2 = uk.PK2; userKey.SK.X1 = uk.SK1; userKey.SK.X2 = uk.SK2; PRE_Cipher CKey = new PRE_Cipher(); CKey.E = si.CKey_E; CKey.F = si.CKey_F; CKey.U = si.CKey_U; CKey.W = si.CKey_W; String key = ProxyReEncryption.KeyDecrypt(userKey, CKey); FileMetaData fi = new FileMetaData(); fi.FileName = fileName; fi.FilePath = this.dropBoxController.DropboxSecuruStikFolder2SecuruStikFolder(dropboxPath); fi.Key = key; fi.PlainTextHash = ""; fi.CryptTextHash = ""; PreKeyring.FileInfo_Update(fi); String dropboxRemotePath = this.dropBoxController.SecuruStikFolder2RemoteDropboxPath(fi.FilePath); this.dropBoxController.CopyAsync(copyRef, dropboxRemotePath); } catch (System.Exception ex) { log.ErrorFormat("DownloadSharingFile {0}", si.FileName, ex); PreKeyring.SharingFile_Delete(si.Reference); return(false); } return(true); }