Beispiel #1
0
        public void AfterReadApplicationData(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            // dump all records
            foreach (var record in emv.TlvRecords)
            {
                foreach (TlvData tlv in record.GetTags())
                {
                    WriteTlv(tlv.Tag, tlv, TlvDictionary);
                }
            }

            // informations about SDA
            if (emv.Sda != null)
            {
                gui.guiDetailedLogs.AppendText(String.Format("SDA: {0}\n", emv.Sda));
            }
            else
            {
                gui.guiDetailedLogs.AppendText("SDA not supported or unknown Certification Authority\n");
            }
        }
Beispiel #2
0
        private void AfterPseRead(Object sender, EmvEventArgs eventArgs)
        {
            var pse = sender as PaymentSystemEnvironment;

            if (pse == null)
            {
                throw new ArgumentException("sender is not a PaymentSystemEnvironment");
            }

            Console.WriteLine();
            Console.WriteLine("= = = = = = P S E   R e a d");
            Console.WriteLine();

            foreach (var record in pse.TlvRecords)
            {
                foreach (TlvData tlv in record.GetTags())
                {
                    xmlRoot.Elements().Last().Add(tlv.ToXmlNode(xmlDoc));
                    WriteTlv(tlv.Tag, tlv, tagsManager);
                }
            }

            Console.WriteLine();
            Console.WriteLine("=========== P S E   A p p l i c a t i o n s   f o u n d");
            Console.WriteLine();

            foreach (var emvFound in pse.GetApplications())
            {
                Console.WriteLine("  >> Application '{0}' [ {1} ] found", emvFound.Aid, tagsManager.CreateInstance(emvFound.TlvFromPSE.GetTag(0x50)));
            }
        }
Beispiel #3
0
        public void AfterGetData(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            if (emv.TlvATC != null)
            {
                WriteTlv(emv.TlvATC.Tag, emv.TlvATC, TlvDictionary);
            }
            if (emv.TlvLastOnlineATCRegister != null)
            {
                WriteTlv(emv.TlvLastOnlineATCRegister.Tag, emv.TlvLastOnlineATCRegister, TlvDictionary);
            }
            if (emv.TlvPINTryCounter != null)
            {
                WriteTlv(emv.TlvPINTryCounter.Tag, emv.TlvPINTryCounter, TlvDictionary);
            }
            if (emv.TlvLogFormat != null)
            {
                WriteTlv(emv.TlvLogFormat.Tag, emv.TlvLogFormat, TlvDictionary);
            }
        }
Beispiel #4
0
        private void AfterGetProcessingOptions(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            Console.WriteLine();
            Console.WriteLine("= = = = = = E M V   G e t P r o c e s s i n g O p t i o n s   {0}", emv.Aid);
            Console.WriteLine();

            foreach (TlvData tlv in emv.TlvProcessingOptions.GetTags())
            {
                xmlRoot.Elements().Last().Add(tlv.ToXmlNode(xmlDoc));
                WriteTlv(tlv.Tag, tlv, tagsManager);
            }

            Console.WriteLine("    >> {0}", emv.Aip);
            foreach (var file in emv.Afl.Files)
            {
                Console.WriteLine("    >> {0}", file);
            }
        }
Beispiel #5
0
        public void AfterPseRead(Object sender, EmvEventArgs eventArgs)
        {
            var pse = sender as PaymentSystemEnvironment;

            if (pse == null)
            {
                throw new ArgumentException("sender is not a PaymentSystemEnvironment");
            }

            foreach (var record in pse.TlvRecords)
            {
                foreach (TlvData tlv in record.GetTags())
                {
                    WriteTlv(tlv.Tag, tlv, TlvDictionary);
                }
            }

            gui.guiDetailedLogs.AppendText("\n");
            gui.guiDetailedLogs.AppendText("PSE Applications found:\n");

            foreach (var emvFound in pse.GetApplications())
            {
                gui.guiDetailedLogs.AppendText(String.Format("  >> Application '{0}' [ {1} ] found\n", emvFound.Aid, TlvDictionary.CreateInstance(emvFound.TlvFromPSE.GetTag(0x50))));
            }
        }
Beispiel #6
0
        private void AfterGetData(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            Console.WriteLine();
            Console.WriteLine("= = = = = = E M V   G e t D a t a   {0}", emv.Aid);
            Console.WriteLine();

            if (emv.TlvATC != null)
            {
                xmlRoot.Elements().Last().Add(emv.TlvATC.ToXmlNode(xmlDoc));
                WriteTlv(emv.TlvATC.Tag, emv.TlvATC, tagsManager);
            }
            if (emv.TlvLastOnlineATCRegister != null)
            {
                xmlRoot.Elements().Last().Add(emv.TlvLastOnlineATCRegister.ToXmlNode(xmlDoc));
                WriteTlv(emv.TlvLastOnlineATCRegister.Tag, emv.TlvLastOnlineATCRegister, tagsManager);
            }
            if (emv.TlvPINTryCounter != null)
            {
                xmlRoot.Elements().Last().Add(emv.TlvPINTryCounter.ToXmlNode(xmlDoc));
                WriteTlv(emv.TlvPINTryCounter.Tag, emv.TlvPINTryCounter, tagsManager);
            }
            if (emv.TlvLogFormat != null)
            {
                xmlRoot.Elements().Last().Add(emv.TlvLogFormat.ToXmlNode(xmlDoc));
                WriteTlv(emv.TlvLogFormat.Tag, emv.TlvLogFormat, tagsManager);
            }
        }
Beispiel #7
0
        private void BeforePseRead(Object sender, EmvEventArgs eventArgs)
        {
            Console.WriteLine();
            Console.WriteLine("=========== P S E   R e a d");
            Console.WriteLine();

            xmlRoot.Add(new XElement("PSERead"));
        }
Beispiel #8
0
        private void afterVerifyPinEventHandler(Object sender, EmvEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => afterVerifyPinEventHandler(sender, eventArgs)));
                return;
            }

            updateAfterAIDSelect_Content(sender as EmvApplication);
        }
Beispiel #9
0
        private void afterPSESelectEventHandler(Object sender, EmvEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => afterPSESelectEventHandler(sender, eventArgs)));
                return;
            }

            var df = sender as EmvDefinitionFile;

            updateAfterPSESelect_Content(df);
        }
Beispiel #10
0
        private void afterPSEReadEventHandler(Object sender, EmvEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => afterPSEReadEventHandler(sender, eventArgs)));
                return;
            }

            var pse = sender as PaymentSystemEnvironment;

            updateAfterPSEReadRecords_Content(pse);
        }
Beispiel #11
0
        private void afterGenerateAC1EventHandler(Object sender, EmvEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => afterGenerateAC1EventHandler(sender, eventArgs)));
                return;
            }

            var emv = sender as EmvApplication;

            updateAfterAIDSelect_Content(emv);
            UpdateTvr(emv);
        }
Beispiel #12
0
        private void afterReadLogFileEventHandler(Object sender, EmvEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => afterReadLogFileEventHandler(sender, eventArgs)));
                return;
            }

            var emv = sender as EmvApplication;

            UpdateLogRecords(emv);
            UpdateTvr(emv);
        }
Beispiel #13
0
        public void BeforeGetChallenge(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            gui.guiDetailedLogs.AppendText("\n");
            gui.guiDetailedLogs.AppendText(String.Format("E M V   G e t C h a l l e n g e   {0}\n", emv.Aid));
            gui.guiDetailedLogs.AppendText("\n");
        }
Beispiel #14
0
        public void BeforeApplicationSelection(Object sender, EmvEventArgs eventArgs)
        {
            var df = sender as EmvDefinitionFile;

            if (df == null)
            {
                throw new ArgumentException("sender is not an EmvDefinitionFile");
            }

            gui.guiDetailedLogs.AppendText("\n");
            gui.guiDetailedLogs.AppendText(String.Format("E M V   A I D   S e l e c t i o n   {0}\n", df.Aid));
            gui.guiDetailedLogs.AppendText("\n");
        }
Beispiel #15
0
        public void AfterGetChallenge(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            if (emv.IccChallenge != null)
            {
                gui.guiDetailedLogs.AppendText(String.Format("    >> {0}\n", emv.IccChallenge.ToHexa()));
            }
        }
Beispiel #16
0
        private void BeforeApplicationSelection(Object sender, EmvEventArgs eventArgs)
        {
            var df = sender as EmvDefinitionFile;

            if (df == null)
            {
                throw new ArgumentException("sender is not an EmvDefinitionFile");
            }

            Console.WriteLine();
            Console.WriteLine("=========== E M V   A I D   S e l e c t i o n   {0}", df.Aid);
            Console.WriteLine();

            xmlRoot.Add(new XElement("ApplicationSelection"));
        }
Beispiel #17
0
        private void BeforeGetData(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            Console.WriteLine();
            Console.WriteLine("=========== E M V   G e t D a t a   {0}", emv.Aid);
            Console.WriteLine();

            xmlRoot.Add(new XElement("GetData"));
        }
Beispiel #18
0
        public void BeforeGenerateAc1(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            gui.guiDetailedLogs.AppendText("\n");
            gui.guiDetailedLogs.AppendText(String.Format("E M V   G e n e r a t e A C 1   {0}\n", emv.Aid));
            gui.guiDetailedLogs.AppendText("\n");

            gui.guiDetailedLogs.AppendText(String.Format("    >> Requested AC: {0}\n", emv.RequestedAC1Type));
            gui.guiDetailedLogs.AppendText(String.Format("    >> Unpredictable Number: {0}\n", emv.TlvGenerateAC1UnpredictableNumber));
        }
Beispiel #19
0
        private void afterReadApplicationDataEventHandler(Object sender, EmvEventArgs eventArgs)
        {
            if (InvokeRequired)
            {
                Invoke(new MethodInvoker(() => afterReadApplicationDataEventHandler(sender, eventArgs)));
                return;
            }

            var emv = sender as EmvApplication;

            updateAfterAIDSelect_Content(emv);
            UpdatePublicKeysTab(emv);
            UpdateAuthenticationTabSdaDone(emv);
            UpdateAuthenticationTabSignedData(emv);
            UpdateTvr(emv);
        }
Beispiel #20
0
        public void AfterGenerateAc1(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            if (emv.TlvGenerateAC1Response == null)
            {
                return;
            }

            WriteTlv(emv.TlvGenerateAC1Response.Tag, emv.TlvGenerateAC1Response, TlvDictionary);
            gui.guiDetailedLogs.AppendText(String.Format("    >> Cryptogram Information Data: {0}\n", emv.Cid1));
            gui.guiDetailedLogs.AppendText(String.Format("    >> Application Cryptogram Counter: {0}\n", emv.AtcFromAC1));
        }
Beispiel #21
0
        private void AfterReadApplicationData(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            Console.WriteLine();
            Console.WriteLine("= = = = = = E M V   R e a d A p p l i c a t i o n D a t a   {0}", emv.Aid);
            Console.WriteLine();

            foreach (var record in emv.TlvRecords)
            {
                foreach (TlvData tlv in record.GetTags())
                {
                    xmlRoot.Elements().Last().Add(tlv.ToXmlNode(xmlDoc));
                    WriteTlv(tlv.Tag, tlv, tagsManager);
                }
            }
        }
Beispiel #22
0
        public void AfterApplicationSelection(Object sender, EmvEventArgs eventArgs)
        {
            var df = sender as EmvDefinitionFile;

            if (df == null)
            {
                throw new ArgumentException("sender is not an EmvDefinitionFile");
            }

            if (df.TlvFci != null)
            {
                gui.guiDetailedLogs.AppendText(String.Format("  >> TLV: {0}\n", df.TlvFci));
                foreach (TlvData tlv in df.TlvFci.GetTags())
                {
                    WriteTlv(tlv.Tag, tlv, TlvDictionary);
                }
            }
            else
            {
                gui.guiDetailedLogs.AppendText("  >> AID not found\n");
            }
        }
Beispiel #23
0
        private void AfterApplicationSelection(Object sender, EmvEventArgs eventArgs)
        {
            var df = sender as EmvDefinitionFile;

            if (df == null)
            {
                throw new ArgumentException("sender is not an EmvDefinitionFile");
            }

            Console.WriteLine();
            Console.WriteLine("= = = = = = E M V   A I D   S e l e c t i o n   {0}", df.Aid);
            Console.WriteLine();

            if (df.TlvFci != null)
            {
                Console.WriteLine("  >> TLV: " + df.TlvFci);
                foreach (TlvData tlv in df.TlvFci.GetTags())
                {
                    xmlRoot.Elements().Last().Add(tlv.ToXmlNode(xmlDoc));
                    WriteTlv(tlv.Tag, tlv, tagsManager);
                }
            }
        }
Beispiel #24
0
        public void AfterGetProcessingOptions(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            if (emv.TlvProcessingOptions == null)
            {
                return;
            }
            foreach (TlvData tlv in emv.TlvProcessingOptions.GetTags())
            {
                WriteTlv(tlv.Tag, tlv, TlvDictionary);
            }

            gui.guiDetailedLogs.AppendText(String.Format("    >> {0}\n", emv.Aip));
            foreach (var file in emv.Afl.Files)
            {
                gui.guiDetailedLogs.AppendText(String.Format("    >> {0}\n", file));
            }
        }
Beispiel #25
0
        public void AfterInternalAuthenticate(Object sender, EmvEventArgs eventArgs)
        {
            var emv = sender as EmvApplication;

            if (emv == null)
            {
                throw new ArgumentException("sender is not an EMVApplication");
            }

            if (emv.TlvSignedDynamicApplicationResponse != null)
            {
                WriteTlv(emv.TlvSignedDynamicApplicationResponse.Tag, emv.TlvSignedDynamicApplicationResponse, TlvDictionary);
            }

            // informations about DDA
            if (emv.Dda != null)
            {
                gui.guiDetailedLogs.AppendText(String.Format("DDA: {0}", emv.Dda));
            }
            else
            {
                gui.guiDetailedLogs.AppendText("DDA not supported or unknown Certification Authority");
            }
        }
Beispiel #26
0
 public void AfterReadLogFile(Object sender, EmvEventArgs eventArgs)
 {
 }
Beispiel #27
0
 public void BeforePseRead(Object sender, EmvEventArgs eventArgs)
 {
     gui.guiDetailedLogs.AppendText("\n");
     gui.guiDetailedLogs.AppendText("P S E   R e a d\n");
     gui.guiDetailedLogs.AppendText("\n");
 }
Beispiel #28
0
 public void BeforePseSelection(Object sender, EmvEventArgs eventArgs)
 {
     gui.guiDetailedLogs.AppendText("\n");
     gui.guiDetailedLogs.AppendText("P S E   S e l e c t i o n\n");
     gui.guiDetailedLogs.AppendText("\n");
 }
Beispiel #29
0
 public void AfterVerifyPin(Object sender, EmvEventArgs eventArgs)
 {
 }