Skip to Main Content

Java Card

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading the UID of a Standard MiFare Card via OMNIKEY reader

843851Sep 2 2010 — edited Sep 2 2010
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2010
Added on Sep 2 2010
2 comments
1,960 views