Пример #1
0
        public string GetTan(FinService aService)
        {
            if (m_vList.Count == 0)
            {
                throw new InvalidOperationException("Keine TAN-Nummern in Liste!");
            }

            FinTanProcessParameters aTanProc       = aService.TanProcess;
            FinChallengeInfo        aChallengeInfo = aService.ChallengeInfo;

            // If this is not a 2-step TAN procedure then we always just return the very first
            // TAN of the list.

            if ((aTanProc == null) || (aChallengeInfo == null))
            {
                Tan aTan = (Tan)m_vList[0];
                return(aTan.TAN);
            }

            string sChallenge = aChallengeInfo.Challenge;
            int    nIndex     = GetIndexFromChallenge(sChallenge);

            if (nIndex >= 0)
            {
                string sTAN = FindTan(nIndex);
                if (sTAN != null)
                {
                    return(sTAN);
                }
            }

            io.Write("Keine TAN für " + sChallenge + "in TAN-Datei gefunden!");
            return(null);
        }
Пример #2
0
        public string GetTan(FinService aService)
        {
            FinTanProcessParameters tanProcess     = aService.TanProcess;
            FinChallengeInfo        aChallengeInfo = aService.ChallengeInfo;

            if ((tanProcess != null) && (aChallengeInfo != null))
            {
                io.Write(tanProcess.ChallengeLabel + ": ");
                io.Write(aChallengeInfo.Challenge);
            }

            io.Write("TAN:");

            string sTAN = io.Read();

            return(!string.IsNullOrEmpty(sTAN) ? sTAN : null);
        }