HI all,
I am trying to get the UID of a standard Mifare Card using OMNIKEY reader ,
However after several attempts and workarounds I am still unable to get one.
Got Some help from
[http://forums.sun.com/thread.jspa?threadID=5218764|http://forums.sun.com/thread.jspa?threadID=5218764]
but still the issue remains unresolved.
I tried using the getUID() as suggested.
using the APDU: FF CA 00 00 00 I am geting error 6270, which shows wrong length
where as when i give FF CA 00 00 04, it gives response as 99 00 and the UID uit returns is
something like *b~
Now this is illegible , please suggest me how to get The UID now
////This method gets the UID of a contactless card
public byte[] getUID() throws MifareConnectionException {
final CommandAPDU GET_UID = new CommandAPDU(
0xFF,//CLA
0xCA,//INS
0x00,//P1
0x00,//P2
0x04);//Le
try {
System.out.println("Getting UID");
byte[] response = issueNormalCmd(GET_UID);
System.out.println(" response: "+response);
return response;
} catch (CardException ex) {
throw new MifareConnectionException("Error in card channel", ex);
}
}
Noe the UID i am getting is in some encoded format.
Please suggest some h way to get this done.
Regards ,
Dush