public CardHandler(ICard cardOwner)
        {
            this.card       = cardOwner as IISO7816Card;
            context         = new CardContext();
            context.CurFile = card.MasterFile;

            commandMap[0x0044] = new ActivateFile();
            commandMap[0x00e2] = new AppendRecord();
            commandMap[0x9024] = new ChangeKeyData();
            commandMap[0x0024] = new ChangeReferenceData();
            commandMap[0x00e0] = new CreateFile();
            commandMap[0x0004] = new DeactivateFile();
            commandMap[0x0082] = new ExternalAuthenticate();
            commandMap[0x0046] = new GenerateKeyPair();
            commandMap[0x0084] = new GetChallenge();
            commandMap[0x8086] = new GiveRandom();
            commandMap[0x0022] = new ManageSecurityEnvironment();
            commandMap[0x002a] = new PerformSecurityOperation();
            commandMap[0x00da] = new PutData();
            commandMap[0x00b0] = new ReadBinary();
            commandMap[0x00b2] = new ReadRecord();
            commandMap[0x002c] = new ResetRetryCounter();
            commandMap[0x00a4] = new Select();
            commandMap[0x00d6] = new UpdateBinary();
            commandMap[0x00dc] = new UpdateRecord();
            commandMap[0x0020] = new Verify();


            foreach (var v in commandMap.Values)
            {
                v.Card    = card;
                v.Handler = this;
            }
        }
 public byte[] ResetCard(bool warm)
 {
     context         = new CardContext();
     context.CurFile = card.MasterFile;
     return(card.ATR);
 }
        public CardHandler(ICard cardOwner)
        {
            this.card = cardOwner as IISO7816Card;
            context = new CardContext();
            context.CurFile = card.MasterFile;

            commandMap[0x0044] = new ActivateFile();            
            commandMap[0x00e2] = new AppendRecord();
            commandMap[0x9024] = new ChangeKeyData();
            commandMap[0x0024] = new ChangeReferenceData();
            commandMap[0x00e0] = new CreateFile();
            commandMap[0x0004] = new DeactivateFile();
            commandMap[0x0082] = new ExternalAuthenticate();
            commandMap[0x0046] = new GenerateKeyPair();
            commandMap[0x0084] = new GetChallenge();
            commandMap[0x8086] = new GiveRandom();
            commandMap[0x0022] = new ManageSecurityEnvironment();
            commandMap[0x002a] = new PerformSecurityOperation();
            commandMap[0x00da] = new PutData();
            commandMap[0x00b0] = new ReadBinary();
            commandMap[0x00b2] = new ReadRecord();
            commandMap[0x002c] = new ResetRetryCounter();
            commandMap[0x00a4] = new Select();
            commandMap[0x00d6] = new UpdateBinary();
            commandMap[0x00dc] = new UpdateRecord();
            commandMap[0x0020] = new Verify();
            

            foreach (var v in commandMap.Values) {
                v.Card = card;
                v.Handler = this;
            }

        }
 public byte[] ResetCard(bool warm)
 {
     context = new CardContext();
     context.CurFile = card.MasterFile;
     return card.ATR;
 }