I have a Gemplus GCR410 card reader. I've tried to send a simple APDU to the
card but get an error returned fro SCardTansmit, number 00000057. The
opencard.properties I have is reproduced below:
OpenCard.services = opencard.opt.util.PassThruCardServiceFactory
# PCSC
OpenCard.terminals =
com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory
OpenCard.trace = opencard:5
The application is very simple, and again shown below:
import opencard.core.service.SmartCard;
import opencard.core.service.CardRequest;
import opencard.core.terminal.CommandAPDU;
import opencard.core.terminal.ResponseAPDU;
import opencard.opt.util.PassThruCardService;
public class ReadFile
{
public static void main (String[] args)
{
try
{
SmartCard.start();
System.out.println("Please Insert Your Smart Card");
CardRequest cr = new CardRequest();
cr.setWaitBehavior(CardRequest.ANYCARD);
SmartCard sc = SmartCard.waitForCard(cr);
if (sc == null)
{
// Handle error
}
else
{
PassThruCardService ptcs = new PassThruCardService();
byte[] data = { (byte)0x00, (byte)0xa0, (byte)0xa4, (byte)0x00,
(byte)0x00, (byte)0x3f, (byte)0x00};
CommandAPDU cmdAPDU = new CommandAPDU(data);
System.out.println(cmdAPDU.toString());
ResponseAPDU rspAPDU = new ResponseAPDU(50);
ptcs = (PassThruCardService)
sc.getCardService(PassThruCardService.class,true);
// Issue the select command above
rspAPDU = ptcs.sendCommandAPDU(cmdAPDU);
System.out.println(rspAPDU.toString());
sc.close();
}
}
catch (Exception e)
{
e.printStackTrace();
}
finally
{
try
{
SmartCard.shutdown();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
Are there any known problems whith the PCSC10 CardTerminal? Has anyone got
the GCR410 working with PCSC?
Thanks
Dev.
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.