Esempio n. 1
0
        public Banking()
        {
            var conf = (string)ConfigurationManager.AppSettings ["ConfigFile"];

            config = new ProviderConfig(conf);

            passkey = (string)ConfigurationManager.AppSettings ["Passkey"];

            // see if we have SHA1 or SHA256 hashes
            try {
                // conversion will NOT yield correct integer result, but
                Convert.ToInt32(passkey, 16);
                log.Debug(passkey);
                switch (passkey.Length)
                {
                case 40:
                    passkeyType = PasskeyType.SHA1;
                    break;

                case 64:
                    passkeyType = PasskeyType.SHA256;
                    break;

                default:
                    passkeyType = PasskeyType.Plaintext;
                    break;
                }
            } catch {
                // its not a hex represenation
                log.Debug("caught exception");
                passkeyType = PasskeyType.Plaintext;
            }
        }
Esempio n. 2
0
        public Banking()
        {
            var conf = (string)ConfigurationManager.AppSettings ["ConfigFile"];
            config = new ProviderConfig (conf);

            passkey = (string)ConfigurationManager.AppSettings ["Passkey"];

            // see if we have SHA1 or SHA256 hashes
            try {
                // conversion will NOT yield correct integer result, but
                Convert.ToInt32 (passkey, 16);
                log.Debug (passkey);
                switch (passkey.Length) {
                case 40:
                    passkeyType = PasskeyType.SHA1;
                    break;
                case 64:
                    passkeyType = PasskeyType.SHA256;
                    break;
                default:
                    passkeyType = PasskeyType.Plaintext;
                    break;
                }
            } catch {
                // its not a hex represenation
                log.Debug ("caught exception");
                passkeyType = PasskeyType.Plaintext;
            }
        }