public bool ParseISBPath(string pRealPage, out Guid?pSessionID, out cdeSenderType pType, out long pFID, out string pVersion) { pSessionID = null; pType = cdeSenderType.NOTSET; pFID = 0; pVersion = ""; var tRealPage = CU.cdeDecrypt(pRealPage, MySecrets?.GetAI(), true); if (tRealPage?.StartsWith(MySecrets?.GetApID5()) != true) { return(false); } string[] tQ = tRealPage.Split('&'); pType = tQ.Length == 4 ? (cdeSenderType)(CU.CInt(tQ[2])) : cdeSenderType.NOTSET; if (tQ.Length > 1) { pFID = CU.CLng(tQ[1]); } if (tQ.Length > 3) { pSessionID = CU.CGuid(tQ[3]); } if (tQ[0].Length == 7) { pVersion = tQ[0].Substring(5); } return(true); }
/// <summary> /// Returns the total costs of the Message in form of a TSMTotalCost receipt /// </summary> /// <returns></returns> public TSMTotalCost GetTotalCosts() { if (string.IsNullOrEmpty(CST)) { return(null); } string[] tItems = TheCommonUtils.cdeSplit(CST, ";:;", true, true); TSMTotalCost tTotal = new TSMTotalCost() { Items = new List <TSMCosting>() }; foreach (string t in tItems) { string[] tt = TheCommonUtils.cdeDecrypt(t, TheBaseAssets.MySecrets.GetAI()).Split(';'); //3.083: Must be cdeAI if (tt.Length < 4) { continue; } TSMCosting tCost = new TSMCosting(TheCommonUtils.CInt(tt[0]), TheCommonUtils.CStr(tt[1]), TheCommonUtils.CStr(tt[2]), TheCommonUtils.CStr(tt[3])); tTotal.Items.Add(tCost); tTotal.TotalCredits += tCost.Credits; tTotal.TotalItems++; } return(tTotal); }
/// <summary> /// Decrypts a byte array to a string using internal AES encryption /// </summary> /// <param name="OrgBuffer">Buffer to be decrypted</param> /// <param name="pType">Current only supported type: "AIV1"</param> /// <returns></returns> public string DecryptToString(string OrgBuffer, string pType) { switch (pType) { case "CDEP": if (OrgBuffer.StartsWith("&^CDESP1^&:")) { return(CU.cdeDecrypt(OrgBuffer.Substring(11), MySecrets?.GetNodeKey())); } break; } return(null); }
public string GetSessionIDFromISB(string pRealPage) { var tRealPage = CU.cdeDecrypt(pRealPage, MySecrets?.GetAI(), true); if (tRealPage?.StartsWith(MySecrets?.GetApID5()) != true) { return(null); } string[] tQ = tRealPage.Split('&'); if (tQ.Length > 3) { return(tQ[3]); } return(null); }
public string GetRealScopeID(string pScramScopeId) { if (string.IsNullOrEmpty(pScramScopeId)) { return(""); } pScramScopeId = pScramScopeId.Split(chunkSeparator, StringSplitOptions.None)[0]; string[] tStr = CU.cdeDecrypt(pScramScopeId, MySecrets?.GetAI(), true).Split('&'); MyServiceHostInfo?.MyKPIs?.IncrementKPI(eKPINames.KPI5); if (tStr.Length > 1 && MySecrets?.IsInApplicationScope(tStr[1]) == true) { return(tStr[1]); } else { return(""); } }