I'm trying to pass though APDUs command via HID OMNIKEY 5427 CK to operate MIFARE Card ie. Ultralight C card, on the Windows 10 x64 OS environment using WinSCard.dll. (I'm under NXP NDA and have full access t their documents)
I tried to find information online for days now. Seem like no published document for this model except the 2pages brochure.
The simple command like GetUID (FFCA000000) is OK, I can get back the actual card UID.
But for 'Authentication with Card', reference document from HID 5421 model said I should start with OpenGenericSession (FFA0000703010001), I tried that and reader always replied with 6D00h (error)
I tried send Authentication command directly '1Ah+00h' (FFA00005080100F30000641A0000) the reader also always replied with error code.
I've experience with HID 5421 model and it quite straight forward, not sure why this 5427 is unlike its sibling.
And yes, I contacted HID support. No luck. No useful information I could get from them.
If any one have idea or have 5427 software development guide please help. I'm pulling my hair for almost a week by now.
Below is a proof-of-concept java code to communicate with Ultralight-C over Generic Session using Omnikey 5321/6321:
Note 1: this code uses javax.smartcardio and Apache Commons Lang.
Note 2: It has been some time I wrote this code, please validate my thoughts...
Note 3: For Ultralight-C authentication code see this companion answer.
Generic session example trace for Omnikey 6321 with Ultralight-C (single line arrows denote Generic Session APDUs and double line arrows denote Ultralight-C commands):
Some additional notes:
(AFAIK) This approach works under Windows (with Omnikey drivers). It does not work under linux (even with Omnikey drivers).
Note that PC/SC version 2.02 Part 3 defines
MANAGE SESSION
,TRANSAPARENT EXCHANGE
andSWITCH PROTOCOL
commands which provide the same in a standardized way (your reader might support it instead of proprietary generic session mechanism -- HID even participated on this document).Good luck!