/// <summary>Initializes a new instance of the <see cref="InvalidApduException" /> class.</summary>
 /// <param name="message">The error message.</param>
 /// <param name="apdu">The APDU.</param>
 /// <param name="innerException">The inner exception.</param>
 public InvalidApduException(string message, Apdu apdu, Exception innerException)
     : base(message, innerException)
 {
     _apdu = apdu;
     try {
         ApduBytes = apdu.ToArray();
     } catch (Exception exception) {
         Trace.TraceError("Could not get APDU bytes: {0}", exception);
     }
 }
        private void getChallengeButton_Click(object sender, EventArgs e)
        {
            var apdu = new Apdu(0, InstructionCode.GetChallenge, 0, 0, 8);
            Program.Log(string.Format("Send APDU with \"GET CHALLENGE\" command:\r\n\t{0}", apdu));

            var result = apdu.Execute(Reader);
            if (result == null)
                Program.Log("No result.");
            else Program.Log(string.Format("Result: {0}", new SCResult(result)));
        }
 public byte[] Should_the_result_match_the_expected_result(Apdu apdu)
 {
     return apdu.ToArray();
 }
 public InvalidApduException(string message, Apdu apdu, Exception innerException)
     : base(message, innerException)
 {
     this.apdu = apdu;
 }
 public InvalidApduException(string message, Apdu apdu, Exception innerException)
     : base(message, innerException)
 {
     this.apdu = apdu;
 }