I need to emulate a DESFire EV1 card on an Android device. However, I'm confused on how to use the Mifare SDK (lite or advanced) with the HCE.
Is that even possible? I need to start the project and I had a lot of researches about how the data are stored and ciphered in the DESFire cards but I ended up with the fact that I need to use Mifare SDK on HCE.
First of all, you cannot use the MIFARE SDK to emulate cards. The MIFARE SDK provides reader-side functionality only.
Second, you cannot emulate the whole functionality of MIFARE DESFire (EV1) cards using Android HCE. However, you can emulate parts of the MIFARE DESFire protocols (more specifically, you can only emulate ISO/IEC 7816-4 framing (either ISO command set or wrapped native command set) and only if preceded by an ISO SELECT by AID command). If that's sufficient depends on the requirements of the reader side of your system.
D2760000850100
): You can register your HCE service for the DESFire AID and will be able to receive all wrapped native commands after this AID has been selected.Note that there may be licensing issues if you emulate MIFARE DESFire cards.