public string EncryptDataAndSignature([FromBody] PayloadXml payload) { var key = "b14ca5898a4e4133bbce2ea2315a1916"; //32-bytes var nonce = "b14ca5898a4e"; //12-bytes var assocdata = "done"; //DateTime.Now.ToString("yyyyMMddHHmmssfff"); try { var idtpCrypto = new IDTPSecurity.IDTPCryptoServices(); (byte[] cipherText, byte[] tag)resultEncryption = idtpCrypto.Encrypt( Encoding.UTF8.GetBytes(payload.xmlData), Encoding.UTF8.GetBytes(key), Encoding.UTF8.GetBytes(nonce), Encoding.UTF8.GetBytes(assocdata)); byte[] encryptedText = resultEncryption.cipherText; byte[] tagHMAC = resultEncryption.tag; var strEncrypData = "Encrypted Text = " + Convert.ToBase64String(encryptedText) + " Encrypted Signature = " + Convert.ToBase64String(tagHMAC); //DBUtility.OneInsertSpTran(payload.transactionId, payload.clientRequestTime, "SP_OneInsertWithSpTran"); return(strEncrypData); } catch (Exception) { throw; } }
public string NoWriteDataPayload([FromBody] PayloadXml payload) { try { return("Insert Successfull"); } catch (Exception) { throw; } }
public string TransferFundNoXmlCsv([FromBody] PayloadXml payload) { try { DBUtility.TransferFundFinalSp("AddTransaction_V2"); return("Insert Successfull"); } catch (Exception ex) { return(ex.Message); } }
public string WriteInBuffer([FromBody] PayloadXml payload) { try { using (var stream = new MemoryStream()) { var sw = new StreamWriter(stream); sw.Write(payload.xmlData); sw.Flush(); stream.Position = 0; //using (var streamReader = new StreamReader(stream)) { // var output= streamReader.ReadToEnd(); //} } } catch (Exception ex) { return(ex.Message); } return($"Written data In Buffer"); }