Exemplo n.º 1
0
        public static string ExpandSAFCore()
        {
            string result;

            try
            {
                string cipherString = SAFConfiguration.readConnectionStringCoreEncrypted();
                string text         = CryptorEngineTripleDES.Decrypt(cipherString, SAFSecurityKeys.getSecurityInfoFromWConfig(), true);
                result = text;
            }
            catch (Exception ex)
            {
                LOGGER.Write(LOGGER.LogCategory.ERROR, "SF.Expand.SAF.Core.DBConnectionString::ExpandSAFCore[]\r\n" + ex.Message, null);
                result = null;
            }
            return(result);
        }
Exemplo n.º 2
0
        public static string ExpandSAFCore()
        {
            string result;

            try
            {
                result = CryptorEngineTripleDES.Decrypt(SAFConfiguration.readConnectionStringCoreEncrypted(), new SecurityInfo(SAFConfiguration.readMasterKey(), SAFConfiguration.readInfoKey(), SAFConfiguration.readInfoIV()), true);
            }
            catch (Exception ex)
            {
                SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFCORE", new string[]
                {
                    "http://sfexpand.SAFCore.dbConnectionString.softfinanca.com/",
                    Assembly.GetExecutingAssembly().FullName.ToString(),
                    ex.ToString()
                });
                result = null;
            }
            return(result);
        }
Exemplo n.º 3
0
        public override void ProcessMessage(SoapMessage message)
        {
            try
            {
                if (message.Stage == SoapMessageStage.AfterDeserialize)
                {
                    string _mtd         = this._processSoap(message);
                    string _userExecute = string.Format("USERID '{0}'  ", "unknown");
                    foreach (SoapHeader header in message.Headers)
                    {
                        if (header is AuthHeader)
                        {
                            AuthHeader credentials = (AuthHeader)header;
                            try
                            {
                                switch (credentials.CryptoAlgorithm)
                                {
                                case AuthHeader.CryptoAlgorithmEnum.NONE:
                                    _userExecute = string.Format("USERID '{0}'  ", credentials.AuthKey.Split(new char[]
                                    {
                                        '|'
                                    })[0]);
                                    break;

                                case AuthHeader.CryptoAlgorithmEnum.TRIPLEDES:
                                    _userExecute = string.Format("USERID '{0}'  ", CryptorEngineTripleDES.Decrypt(SAFConfiguration.readConnectionStringCoreEncrypted(), new SecurityInfo(SAFConfiguration.readMasterKey(), SAFConfiguration.readInfoKey(), SAFConfiguration.readInfoIV()), true).Split(new char[]
                                    {
                                        '|'
                                    })[0]);
                                    break;
                                }
                            }
                            catch (SoapException ex)
                            {
                                SAFLOGGER.Write(SAFLOGGER.LOGGEREventID.EXCEPTION, "SAFAPILOGGER", new string[]
                                {
                                    "http://sfexpand.SAFBusiness.AuthExtension.softfinanca.com/",
                                    ex.ToString()
                                });
                            }
                        }
                    }
                    SAFLOGGER.dump(SAFLOGGER.LOGGEREventID.INFORMATION, "SAFAPILOGGER", new string[]
                    {
                        _userExecute + _mtd
                    });
                }
            }
            catch
            {
            }
        }