Пример #1
0
        private void UpdateLogEntryAndFormat(EmvDefinitionFile df)
        {
            var emv = (EmvApplication)df;

            if (emv.LogFormat != null)
            {
                guiCardLogFormat.Text = String.Format("{0}", emv.LogFormat);
            }

            if (emv.LogEntry != null)
            {
                guiCardLogSFI.Text    = String.Format("{0:X2}", emv.LogEntry.Sfi);
                guiCardLogLength.Text = String.Format("{0:X2}", emv.LogEntry.CyclicFileSize);
            }

            if (emv.LogEntry != null && emv.LogFormat != null)
            {
                guiLogFilePresence.Checked = true;
                guiDoCardLogRead.Enabled   = true;
            }
            else
            {
                guiLogFilePresence.Checked = false;
                guiDoCardLogRead.Enabled   = false;
            }
        }
Пример #2
0
        private void updateAfterPSESelect_Content(EmvDefinitionFile df)
        {
            var pse = (PaymentSystemEnvironment)df;

            // Update list of applications found in PSE
            foreach (var emvFound in pse.GetApplications())
            {
                _detailedLogs.ObserveEmv(emvFound);
                ObserveEmv(emvFound);
                _emvApplications.Add(emvFound);
            }
            UpdateApplicationsList();

            var pseNode = new TreeNode(pse.Name);

            var fciNode = new TreeNode("File Control Information");

            pseNode.Nodes.Add(fciNode);

            if (pse.TlvFci != null)
            {
                fciNode.Nodes.Add(ConvertTlvDataToTreeNode(pse.TlvFci, _tlvDictionary));
            }
            else
            {
                var errorNode = new TreeNode(String.Format("PSE named '{0}'/[{1}] not found.", pse.Name, pse.Aid));
                fciNode.Nodes.Add(errorNode);
            }

            guiPSEContent.Nodes.Add(pseNode);
            guiPSEContent.ExpandAll();
        }
Пример #3
0
        private void updateAfterPSEReadRecords_Content(EmvDefinitionFile df)
        {
            var pse = (PaymentSystemEnvironment)df;

            // Update list of applications found in PSE
            foreach (var emvFound in pse.GetApplications())
            {
                _detailedLogs.ObserveEmv(emvFound);
                ObserveEmv(emvFound);
                _emvApplications.Add(emvFound);
            }
            UpdateApplicationsList();

            // Update content of the PSE Records
            var pseNode = new TreeNode(pse.Name);

            var recordsNode = new TreeNode("Records");

            pseNode.Nodes.Add(recordsNode);

            if (pse.TlvRecords.Count != 0)
            {
                byte recordNumber = 0;
                foreach (var tlv70 in pse.TlvRecords)
                {
                    recordNumber++;
                    var recordNode = new TreeNode(String.Format("Record {0}", recordNumber));
                    recordNode.Nodes.Add(ConvertTlvDataToTreeNode(tlv70, _tlvDictionary));
                    recordsNode.Nodes.Add(recordNode);
                }
            }
            else
            {
                var errorNode = new TreeNode(String.Format("No record found in PSE."));
                recordsNode.Nodes.Add(errorNode);
            }

            guiPSEContent.Nodes.Add(pseNode);
            guiPSEContent.ExpandAll();
        }
Пример #4
0
        private void updateAfterAIDSelect_Content(EmvDefinitionFile df)
        {
            var emv = (EmvApplication)df;

            var emvAppNode = new TreeNode(emv.Aid);

            var fciNode = new TreeNode("File Control Information");

            emvAppNode.Nodes.Add(fciNode);

            if (emv.TlvFci != null)
            {
                fciNode.Nodes.Add(ConvertTlvDataToTreeNode(emv.TlvFci, _tlvDictionary));
            }
            else
            {
                var errorNode = new TreeNode(String.Format("EMV application [{0}] not found.", emv.Aid));
                fciNode.Nodes.Add(errorNode);
            }

            var optionsNode = new TreeNode("Processing Options");

            emvAppNode.Nodes.Add(optionsNode);

            if (emv.TlvProcessingOptions != null)
            {
                optionsNode.Nodes.Add(ConvertTlvDataToTreeNode(emv.TlvProcessingOptions, _tlvDictionary));
            }
            else
            {
                var errorNode = new TreeNode(String.Format("Processing Options not found."));
                optionsNode.Nodes.Add(errorNode);
            }

            var aipNode = new TreeNode("Application Interchange Profile");

            optionsNode.Nodes.Add(aipNode);

            if (emv.Aip != null)
            {
                aipNode.Nodes.Add(String.Format("{0}", emv.Aip));
            }
            else
            {
                var errorNode = new TreeNode(String.Format("AIP not found."));
                aipNode.Nodes.Add(errorNode);
            }

            var aflNode = new TreeNode("Application File Locator");

            optionsNode.Nodes.Add(aflNode);

            if (emv.Afl != null)
            {
                foreach (var file in emv.Afl.Files)
                {
                    aflNode.Nodes.Add(new TreeNode(String.Format("{0}", file)));
                }
            }
            else
            {
                var errorNode = new TreeNode(String.Format("AFL not found."));
                aflNode.Nodes.Add(errorNode);
            }

            var recordsNode = new TreeNode("Records");

            emvAppNode.Nodes.Add(recordsNode);

            if (emv.TlvRecords.Count != 0)
            {
                byte recordNumber = 0;
                foreach (var tlv70 in emv.TlvRecords)
                {
                    recordNumber++;
                    var recordNode = new TreeNode(String.Format("Record {0}", recordNumber));
                    recordNode.Nodes.Add(ConvertTlvDataToTreeNode(tlv70, _tlvDictionary));
                    recordsNode.Nodes.Add(recordNode);
                }
            }
            else
            {
                var errorNode = new TreeNode(String.Format("No records found."));
                recordsNode.Nodes.Add(errorNode);
            }

            var dataNode = new TreeNode("Get data");

            emvAppNode.Nodes.Add(dataNode);

            if (emv.TlvATC != null)
            {
                dataNode.Nodes.Add(ConvertTlvDataToTreeNode(emv.TlvATC, _tlvDictionary));
            }
            if (emv.TlvLastOnlineATCRegister != null)
            {
                dataNode.Nodes.Add(ConvertTlvDataToTreeNode(emv.TlvLastOnlineATCRegister, _tlvDictionary));
            }
            if (emv.TlvLogFormat != null)
            {
                dataNode.Nodes.Add(ConvertTlvDataToTreeNode(emv.TlvLogFormat, _tlvDictionary));
            }
            if (emv.TlvPINTryCounter != null)
            {
                dataNode.Nodes.Add(ConvertTlvDataToTreeNode(emv.TlvPINTryCounter, _tlvDictionary));
            }

            guiEMVApplicationsContent.Nodes.Clear();
            guiEMVApplicationsContent.Nodes.Add(emvAppNode);
            guiEMVApplicationsContent.ExpandAll();
        }