title: pcsc-sharp Mifare Authentication
body: <p>I'm using the <a href="https://github.com/danm-de/pcsc-sharp" rel="nofollow noreferrer">pcsc-sharp</a> library to communicate with an ACR122U Reader an read/write information to MIFARE Classic 1k cards.</p>
  
  <p>After getting familiar with the library and the APDU concept I'm able to use the cards UID as identifier in my applications. 
  Now I am in need of setting my own ID's to the card. Therefore I read some manuals regarding NXP's MIFARE (like <a href="https://web.archive.org/web/20161101201335/http://cache.nxp.com/documents/data_sheet/MF1S70YYX_V1.pdf?pspll=1" rel="nofollow noreferrer">MF1S70YYX_V1</a>) and also got some information about <a href="http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx" rel="nofollow noreferrer">ISO 7816-4</a>.  </p>
  
  <p>I'm aware of the need to do authentication before accessing the cards memory to perform read/write operations and I know the standard Key value.</p>
  
  <p>I downloaded the pcsc-sharp examples from GitHub and ran the Mifare1kTest example. I works but <code>card.LoadKey</code> in Line 36 fails. The response values of the Apdu command in <code>LoadKey</code> is SW1=99 SW2=0, which I cannot find in any documentation. Commenting out the "throw new Exception" section makes the example work.</p>
  
  <p>My question now is, which values are the correct ones to pass to <code>Card.LoadKey</code>, respectively which are the correct values to use for parameters in the Apdu Command. What is meant with "keynumber" (Sectornumber - Sector/Block Combination)? Is the <code>LoadKey</code> call necessary, if the example works?</p>