Esempio n. 1
0
        public static string GetXMLHash(XElement XMLElm)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(XMLElm.ToString());
            return(RWCrypt.GetXMLHash(xmlDocument.DocumentElement));
        }
Esempio n. 2
0
        private string ShowNewSite(string licStr)
        {
            string   retval = "";
            XElement oXElement;

            try
            {
                oXElement = XElement.Parse(licStr);
                if (!RWCrypt.VerifyXml(oXElement))
                {
                    return("");
                }
            }
            catch (XmlException ex)
            {
                ProjectData.SetProjectError((Exception)ex);

                ProjectData.ClearProjectError();
                return("");
            }
            if (Operators.CompareString(oXElement.Attribute((XName)"LicenseType").Value, "Server", false) == 0)
            {
                retval = retval + Environment.NewLine + "DataBase: " + oXElement.Attribute((XName)"ServerName").Value;
                retval = retval + Environment.NewLine + "SiteName: " + oXElement.Attribute((XName)"SiteName").Value;
                retval = retval + Environment.NewLine + "SiteTitle: " + oXElement.Attribute((XName)"SiteTitle").Value;
                retval = retval + Environment.NewLine + "DomainName: " + oXElement.Attribute((XName)"DomainName").Value;
                retval = retval + Environment.NewLine + "MaxCountOfWs: " + new int?(Conversions.ToInteger(oXElement.Attribute((XName)"MaxCountOfWS").Value));
                retval = retval + Environment.NewLine + "LicenseXML: " + oXElement;

                return(retval);
            }
            return("");
        }
Esempio n. 3
0
        public static string GetXMLHash(string sXmlElement)
        {
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.LoadXml(sXmlElement);
            return(RWCrypt.GetXMLHash(xmlDocument.DocumentElement));
        }
Esempio n. 4
0
        public static string GeneratePublicKeyFromPrivateKeyAsXML(string sXMLPrivateKey)
        {
            RSACryptoServiceProvider cryptoServiceProvider = new RSACryptoServiceProvider();

            cryptoServiceProvider.FromXmlString(sXMLPrivateKey);
            return(RWCrypt.GeneratePublicKeyFromPrivateKeyAsXML((AsymmetricAlgorithm)cryptoServiceProvider));
        }
Esempio n. 5
0
        public static XElement ReSignXML(XElement oXElement)
        {
            if (oXElement == null)
            {
                return((XElement)null);
            }
            IEnumerable <XElement> source = oXElement.Elements();
            Func <XElement, bool>  predicate;

            //ISSUE: reference to a compiler-generated field
            //      if (RWCrypt._Closure\u0024__.\u0024I9\u002D0 != null)
            //{
            //    // ISSUE: reference to a compiler-generated field
            //    predicate = RWCrypt._Closure\u0024__.\u0024I9\u002D0;
            //}
            //else
            //{
            //    // ISSUE: reference to a compiler-generated field
            //    RWCrypt._Closure\u0024__.\u0024I9\u002D0 = predicate = (Func<XElement, bool>)(x => Operators.CompareString(x.Name.LocalName, "Signature", false) == 0);
            //}
            //source.Where<XElement>(predicate).Remove<XElement>();
            return(RWCrypt.SignXML(oXElement));
        }
Esempio n. 6
0
 public static string EncryptString(string sValue, string sKey = "$@I36FS<dj")
 {
     return(NullToString((object)RWCrypt.Encrypt(sValue, sKey)));
 }