Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
narasimhaks
Posts: 2
Registered: ‎05-09-2011
My Device: Blackberry Smart Card Reader

Communication between the SmartCard and the Smart Card Reader

Hello,

 

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();

readerSession.sendAPDU(commandAPDU, responseAPDU);

 

Regards

Narasimha

Please use plain text.
New Contributor
narasimhaks
Posts: 2
Registered: ‎05-09-2011
My Device: Blackberry Smart Card Reader

Re: Communication between the SmartCard and the Smart Card Reader

Hi,

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

Narasimha

Please use plain text.
Retired
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10

Re: Communication between the SmartCard and the Smart Card Reader

[ Edited ]

Hello,

 

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);

command.setLcData(password.getBytes());

ResponseAPDU response =  new  ResponseAPDU();

sendAPDU(command, response);

 

 

// 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. 

 

 

 

 

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Please use plain text.