예제 #1
0
        private static void buildSeeds(object _params)
        {
            string          text            = null;
            long            num             = 0L;
            int             num2            = RandomGen.Next();
            InMemoryLogging inMemoryLogging = null;
            long            num3            = (long)((object[])_params)[1];
            string          loteID          = (string)((object[])_params)[2];

            string.Concat(new string[]
            {
                "/Process:",
                Thread.CurrentThread.GetHashCode().ToString(),
                " /thread:",
                ((string)((object[])_params)[3]).Trim(),
                " /processing:",
                num3.ToString().Trim(),
                "/{0} "
            });
            ArrayList           arrayList        = (ArrayList)((object[])_params)[4];
            string              masterKey        = SAFConfiguration.readMasterKey();
            TokenTypeBaseParams tkTypeBaseParams = (TokenTypeBaseParams)((object[])_params)[0];
            InMemoryLogging     logString        = InMemoryLogging.GetLogString("seedsThread." + ((string)((object[])_params)[3]).PadLeft(3, '0'), false);

            logString.MaxChars = -1;
            if (tkTypeBaseParams.MovingFactorType == TokenMovingFactorType.TransactionAuthenticationNumber)
            {
                inMemoryLogging          = InMemoryLogging.GetLogString("seedsThreadMatrix." + ((string)((object[])_params)[3]).PadLeft(3, '0'), false);
                inMemoryLogging.MaxChars = -1;
            }
            int num4 = 0;

            while ((long)num4 < num3)
            {
                while (true)
                {
                    text = new Random(num2++).NextDouble().ToString();
                    text = text.Substring(text.Length - 12);
                    ArrayList obj;
                    Monitor.Enter(obj = arrayList);
                    try
                    {
                        if (arrayList.Contains(text))
                        {
                            continue;
                        }
                        arrayList.Add(text);
                    }
                    finally
                    {
                        Monitor.Exit(obj);
                    }
                    break;
                }
                TokenCryptoData tokenCryptoData;
                if (TokensBaseFunctions.TokensCreateNew(tkTypeBaseParams, masterKey, text, "", out tokenCryptoData) == OperationResult.Success)
                {
                    logString.Add(BaseImportExportTokens.Export(tokenCryptoData, loteID));
                    if (tkTypeBaseParams.MovingFactorType == TokenMovingFactorType.TransactionAuthenticationNumber)
                    {
                        inMemoryLogging.Add(text + ";" + string.Join(";", TokensBaseFunctions.tokenTANMatrixArrayFetch(tokenCryptoData, masterKey, "")));
                    }
                    num += 1L;
                }
                num4++;
            }
            logString.Persist();
            if (inMemoryLogging != null)
            {
                inMemoryLogging.Persist();
            }
        }