// Initialize Payloads private void InitializePayloadManager() { // Initialize PayloadManager.Update(false); RefreshPayloads(); try { // Check for local payloads if (PayloadManager.LocalPayloadCount > 0) { // Check for online payloads if (PayloadManager.IsUpdateAvailable) { tssl_Status.Text = Setting.PayloadStatus[0]; } else { tssl_Status.Text = Setting.PayloadStatus[3]; } tssl_Status.Text = Setting.PayloadStatus[3]; } } catch (Exception ex) { PayloadManager.ShowErrorMessage("Unable to load payloads.", ex.Message); } }
private void Tsmi_ImportPayload_Click(object sender, EventArgs e) { try { // Load supported filetypes var files = Directory.GetFiles(PayloadManager.PayloadsDirectory) .Where(file => Regex.IsMatch(file, @"^.+\.(duck|txt)$")); // Get script path foreach (string fileNames in files) { if (tscb_Payloads.SelectedItem.ToString() == Path.GetFileNameWithoutExtension(fileNames)) { //Read payload code to code editor OpenFile(fileNames); tssl_Status.Text = Setting.PayloadStatus[5]; } } } catch (Exception ex) { PayloadManager.ShowErrorMessage("Unable to import payload.", ex.Message); } }
private void Bg_DownloadPayloads_DoWork(object sender, DoWorkEventArgs e) { try { // Begin Forced Update PayloadManager.Update(true); } catch (Exception ex) { PayloadManager.ShowErrorMessage("Unable to update payloads.", ex.Message); } }
public async Task <SecureResponse> CreateSession([FromBody] SecureRequest request) { var result = new SecureResponse(); try { //calculate the encryption Hash var initKey = "1234567890"; //try and extract the empty payload, will fail if the key is wrong var payload = ExtractPayload <EmptyPayLoad>(request, initKey); await Task.Delay(10); result.Payload.Data = PayloadManager.EncryptPayload(EmptyPayLoad.Empty, initKey); } catch (Exception ex) { result.Success = false; result.Message = ex.Message; } return(result); }
public T Extract <T>(string passKey) { return(PayloadManager.DecryptPayload <T>(Data, passKey)); }
public SecurePayload(object dataValue, string passKey) : this() { Data = PayloadManager.EncryptPayload(dataValue, passKey); }
public DefaultLinkPayloadManager(PayloadManager payloadManager) { _payloadManager = payloadManager; }
public DefaultLinkPayloadManager(JsonSerializerSettings settings = null) { _payloadManager = new PayloadManager(new JsonPayloadSerializer(settings).AsEnumerable()); }