private static void CreateEntry(EMVTagMeta emvTagMeta, byte[] value)
        {
            TLV tlv = TLV.Create(emvTagMeta.Tag);

            tlv.Value = value;
            EMVTagDefaultsList.AddToList(tlv);
        }
예제 #2
0
 public SmartTag(EMVTagMeta emvTagMeta, V value)
     : base()
 {
     EMVTagMeta = emvTagMeta;
     Tag        = new T(EMVTagMeta.Tag);
     Val        = value;
 }
예제 #3
0
 private static void AddDDEntry(EMVTagMeta tag, KernelDatabaseBase database)
 {
     if (database.IsPresent(tag.Tag))
     {
         database.Get(EMVTagsEnum.DISCRETIONARY_DATA_FF8106_KRN2).Children.AddToList(TLV.Create(tag.Tag, database.Get(tag).Value));
     }
 }
예제 #4
0
        public static void PackRelatedDataTag(KernelDatabaseBase database, EMVTagMeta tagToPack, TLVList tagListForPack)
        {
            TLV           tlvRelatedData      = database.Get(tagToPack);
            List <byte[]> tlvRelatedDataBytes = new List <byte[]>();

            Logger.Log("Packing tag: " + tagListForPack.ToString());
            foreach (TLV tlv in tagListForPack)
            {
                TLV valForPackDb = database.Get(tlv.Tag.TagLable);
                TLV valForPack;
                if (valForPackDb == null)
                {
                    valForPack = TLV.Create(tlv.Tag.TagLable);
                }
                else
                {
                    byte[] copyVal = new byte[valForPackDb.Value.Length];
                    Array.Copy(valForPackDb.Value, copyVal, valForPackDb.Value.Length);
                    valForPack = TLV.Create(tlv.Tag.TagLable, copyVal);
                }
                valForPack.Val.PackValue(tlv.Val.GetLength());
                Logger.Log("Adding tag: " + valForPack.ToString());
                tlvRelatedDataBytes.Add(valForPack.Value);
            }
            tlvRelatedData.Value = tlvRelatedDataBytes.SelectMany(a => a).ToArray();
        }
예제 #5
0
 public TLV GetDefault(EMVTagMeta tag)
 {
     return(Get(tag));
     //TLV result = Kernel2ConfigurationData.Get(tag.Tag, TransactionRequest.GetTransactionType_9C());
     //if (result == null)
     //    return null;
     //else
     //    return result;
 }
예제 #6
0
        public TLV Get(EMVTagMeta tag)
        {
            TLV result = DataObjects.Get(tag.Tag);

            if (result == null)
            {
                return(null);
            }
            else
            {
                return(result);
            }
        }
예제 #7
0
        public SmartTag(TLV tlv, EMVTagMeta emvTagMeta, V value)
            : base()
        {
            EMVTagMeta = emvTagMeta;

            Tag = new T(EMVTagMeta.Tag);
            Val = value;

            if (tlv != null && tlv.Val.Value.Length > 0)
            {
                Val.Deserialize(tlv.Val.Serialize(), 0);
            }
        }
예제 #8
0
        public SmartTag(KernelDatabaseBase database, EMVTagMeta emvTagMeta, V value)
            : base()
        {
            this.database = database;
            EMVTagMeta    = emvTagMeta;

            Tag = new T(EMVTagMeta.Tag);
            Val = value;

            TLV tlv = database.Get(EMVTagMeta);

            if (tlv != null && tlv.Val.Value.Length > 0)
            {
                Val.Deserialize(tlv.Val.Serialize(), 0);
            }
        }
예제 #9
0
 public void AddTag(EMVTagMeta tag)
 {
     Tags.Add(tag.Tag);
 }
예제 #10
0
 protected void AddDefaultTLV(TLVList list, EMVTagMeta tag, string hexValue)
 {
     list.AddToList(TLV.Create(tag.Tag, Formatting.HexStringToByteArray(hexValue)));
 }