Esempio n. 1
0
 public string GetCardId()
 {
     return(PcscService.ByteArrayToString((ICollection <byte>) this.SendApdu(new byte[5]
     {
         byte.MaxValue,
         (byte)202,
         (byte)0,
         (byte)0,
         (byte)0
     })));
 }
 public void Inititialize(PcscService service, int authenticationTimeout)
 {
     this.AuthTimer                 = new Timer((double)authenticationTimeout);
     this.AuthTimer.AutoReset       = false;
     this.AuthTimer.Elapsed        += new ElapsedEventHandler(this.TimeElapsed);
     this.PcscService               = service;
     this.PcscService.CardInserted += new EventHandler(this.SmartcardInserted);
     this.PcscService.CardRemoved  += new EventHandler(this.SmartcardRemoved);
     if (this.PcscService.CardPresent && !string.IsNullOrEmpty(this.PcscService.CardId))
     {
         this.SmartcardInserted((object)null, EventArgs.Empty);
     }
     this.SuspendService = false;
 }