コード例 #1
0
 private static void logResponse(byte[] addu, APDUresponse res)
 {
     /*
      * logger.Debug(string.Format($"SendAPDU={CTAP2.Common.BytesToHexString(addu)}"));
      * logger.Debug(string.Format($"IsSuccess={res.IsSuccess}"));
      * logger.Debug(string.Format($"Message={res.Message}"));
      * logger.Debug(string.Format($"SW1=0x{res.Sw1:X2},SW2=0x{res.Sw2:X2}"));
      * logger.Debug(string.Format($"Data={CTAP2.Common.BytesToHexString(res.Data)}"));
      */
 }
コード例 #2
0
 public void Marge(APDUresponse add)
 {
     if (add.Data != null)
     {
         this.Data = Data.Concat(add.Data).ToArray();
     }
     this.Sw1       = add.Sw1;
     this.Sw2       = add.Sw2;
     this.IsSuccess = add.IsSuccess;
     this.Message   = add.Message;
 }
コード例 #3
0
        public APDUresponse SendandResponse(byte[] apdu)
        {
            APDUresponse res = null;

            try {
                int recvSize = SCardAPI.SCardTransmit(this.handle, apdu, this.recvBuff);
                res = new APDUresponse(recvBuff, recvSize);
            } catch (Exception) {
            } finally {
                logResponse(apdu, res);
            }
            return(res);
        }