public PcScResponse SendApdu(int slotNumber, IApdu apdu) { var response = SendAndReceiveResponse <RdrToPcDataBlock>(new PcToRdrXfrBlock(slotNumber, apdu)); if (response.CommandStatus == CommandStatus.Failed) { throw new Exception("Command Failed"); } var pcscResponse = new PcScResponse(response.Data); if (pcscResponse.Sw1 != Sw1.Normal) { throw new Exception($"PC/SC response does not reflect success. SW1={pcscResponse.Sw1}"); } return(pcscResponse); }
public PcToRdrXfrBlock(int slotNumber, IApdu apdu) { _slotNumber = slotNumber; _apdu = apdu; }