title: Mifare authentication
body: <p>Say I want to authenticate to Mifare Classic.</p>
  
  <p>How do I know the exact kind of APDU to send to the card?</p>
  
  <p><strong>Example.</strong></p>
  
  <p>This code:</p>
  
  <pre><code>bcla = 0xFF;
  bins = 0x86;
  bp1 =  0x0;
  bp2 =  0x0; // currentBlock
  len =  0x5;
  
  sendBuffer[0] = bcla;
  sendBuffer[1] = bins;
  sendBuffer[2] = bp1;
  sendBuffer[3] = bp2;
  sendBuffer[4] = len;
  sendBuffer[5] = 0x1;                // Version
  sendBuffer[6] = 0x0;                // Address MSB
  sendBuffer[7] = currentBlock;
  if(keyradioButton-&gt;Checked==true)   // Address LSB
       sendBuffer[8] = 0x60;              // Key Type A
  else if(keynumberradioButton-&gt;Checked ==true)
      sendBuffer[8] = 0x61;               // Key Type B
  sendBuffer[9] = keynumber;          // Key Number
  
  sendbufferlen = 0xA;
  receivebufferlen = 255;
  
  //Invoke the Transmit command
  retval = SCardTransmit(hCard,  // A reference value returned from the SCardConnect function.
                                   &amp;sioreq, 
                                sendBuffer,  // Send buffer
                             sendbufferlen,  // Send buffer length
                                   &amp;rioreq, 
                             receiveBuffer,  // Receive butter
                        &amp;receivebufferlen);  // Length of received buffer
  </code></pre>
  
  <p>is a sample program which tries to authenticate to Mifare Classic.
  My question is basically, how do I know what kind of APDU to send to the card? e.g., how do I know what should be in the <code>sendBuffer</code>?</p>