05-09-2011 06:41 AM
I am a newbee on the blackberry platform and i am trying to implement the communication between the smart card and the smart card reader on the blackberry simulator.
And according i have implemented the SmartCard and the SmartCardSession Class and also the SmartCardReader and the SmartCardReaderSession class.
I am unable to send the apdu for it to communicate. The code snippet is as shown below. I would appreciate all the help in this regard. Please indicate where i am going wrong or what else i hv to implement.
SmartCardReaderSession readerSession= reader.openSession();
05-17-2011 06:25 AM
I Posted this almost a week ago and i have not got any reply from anyone yet. Any help in this regard would be aprreciated.
Thanks & Regards
05-20-2011 01:13 AM - edited 05-20-2011 01:17 AM
I need a bit more information to be able to assist you please.
Have you successfully installed and registered your smart card driver so that it appears in the list of registered card drivers in the Options app?
Have you verified that your driver is being loaded by the device when you insert the smart card in the smart card reader? A debug session with System.out.println statements in your SmartCard.libMain and
SmartCard.checkAnswerToResetImpl may help to confirm this.
When you do send your APDU , what are the symptoms of being "unable to send the apdu for it to communicate"?
- does an Exception get thrown?
- does nothing seem to happen?
- do either of the status words in the ResponseAPDU object contain values which indicate that there was a problem and if so, what are the values? You can check the status words as follows (example):
CommandAPDU command =
new CommandAPDU(CLASS_00, SmartCardSession.INS_VERIFY, (byte) 0x00, (byte ) 0x00);
ResponseAPDU response = new ResponseAPDU();
// Check for response codes specific to your smart card
System.out.println("XXXX SW1=" + response.getSW1());
System.out.println("XXXX SW2=" + response.getSW2());
If you could get back to me with this information I'll see what I can do to help.