NXP Mifare Card Sample Code for .NET

Mifare card access made easy using SmartCardAPI (pro) including sample code:

  • read or write NXP Mifare Classic card data
  • get a unique identifier (UID, CSN)
  • Mifare card authentication under Mifare card key
  • Mifare Card module available 
  • PC/SC reader support

No need to start reading through NXP Mifare card specifications. Nor do you need to study PC/SC 2.01 part 3 documentation.

Our Mifare card sample code shows C# software module for .NET on top of our Smart card API framework with all this Mifare card knowledge built-in.

Card readers are not all created equal and therefore might require additional tweaks to handle Mifare cards flawlessly. Therefore we test our software with many PC/SC card reader implementations.

SmartCardAPI saves you days of valuable software engineering time.

To make things even easier, we added sample code for Mifare Classic cards to our SDK. With that sample code you can load keys to your reader, authenticate under those keys and access Mifare data blocks. With the access conditions satisfied you can reading and writing any card data.

We have prepared sample code to demonstrate this. and wrapped it in HelloWorld-style sample code “HelloMifareCard” that is part of our standard SDK setup.

Note, that we also have dedicated sample code for Mifare Ultralight and Mifare DESFire EV1 cards in “HelloNfcTag” and “HelloDESFire” respectively.

We are sure you’ll love SmartCardAPI(professional).

Key Features of HelloMifare Sample Code

  • Mifare Classic 1k or 4k
  • PC/SC 2.01 part 3 compliant contactless card reader
  • methods: LoadKey, Authenticate, Read, Write
  • Tracks card events i.e. detects card insertion/removal
  • C# sample code, supports all .NET programming languages including Visual Basic.NET (VB.NET),Visual C#, Visual J#, and Managed C++.

Minimum Requirements

  • Microsoft Visual Studio 2013
  • SmartCard-API (Professional)
  • PC/SC 2.01 part 3 compliant contactless smart card reader
  • Windows 7 , Windows 8 or Windows 10 (32-bit and 64-bit supported)
  • .NET Framework 4.x

Buying a software license of the CardWerk SmartCard API (Professional) edition entitles you to use and redistribute the binary CardWerk SmartCard API (Professional) assembly to your customers at an incredible ROI.

NXP Mifare Classic and Mifare Ultralight support