Exemple #1
0
 /// <summary>
 /// Constractor for the SmartApplication object
 /// </summary>
 /// <param name="selectresponce">The reponce of the card following the SELECT application command </param>
 /// <param name="reader">The IsoReader communicating with the application/card </param>
 public SmartApplication(byte[] selectresponce, IsoReader reader)
 {
     _reader    = reader;
     RES_SELECT = selectresponce;
     TLV_SELECT = new SmartTlv(selectresponce);
     AID        = TLV_SELECT.TagList.Single(t => t.TagStringName == "84").TagValue.ToArray();
 }
Exemple #2
0
 public SmartEmvRecord(int sfi, int record, bool isoffline, byte[] data)
 {
     Sfi            = sfi;
     Record         = record;
     IsOffline      = isoffline;
     RES_READRECORD = data;
     TLV_READRECORD = new SmartTlv(data);
 }
Exemple #3
0
        /// <summary>
        /// Issues a GPO command.
        /// </summary>
        /// <remarks>Pdol data , reponce parsing and storing are handled internaly</remarks>
        public void GetProcessingOptions()
        {
            List <byte> pdoldata = new List <byte> {
                0x83
            };
            var pdol = TLV_SELECT.TagList.SingleOrDefault(t => t.TagStringName == "9F38");

            if (pdol != null)
            {
                var tempdata = TlvTools.parseTagLengthData(pdol.TagValue.ToArray());
                pdoldata.Add((byte)tempdata.Length);
                pdoldata.AddRange(tempdata);
            }
            else
            {
                pdoldata.Add(0x00);
            }

            CommandApdu apdu = new CommandApdu(IsoCase.Case4Short, _reader.ActiveProtocol)
            {
                CLA  = new ClassByte(ClaHighPart.Iso8x, SecureMessagingFormat.None, 0),
                INS  = 0xA8,
                P1   = 0x00,
                P2   = 00,
                Data = pdoldata.ToArray()
            };

            var res = _reader.TransmitWithLog(apdu); // data buffer


            RES_GPO           = res.GetData();
            GpoTemplateFormat = (RES_GPO[0] == (byte)EmvConstants.GpoTemplateFormat.Format1)
                ? EmvConstants.GpoTemplateFormat.Format1
                : EmvConstants.GpoTemplateFormat.Format2;
            TLV_GPO = new SmartTlv(RES_GPO);
        }
Exemple #4
0
 /// <summary>
 /// Prepares the Get processing options command
 /// </summary>
 /// <param name="gpodata"></param>
 public void SetGpo(byte[] gpodata)
 {
     RES_GPO = gpodata;
     TLV_GPO = new SmartTlv(gpodata);
 }