Help.. General Questions using SCR331 w/ CAC

Hey all, Im really new to this stuff and im just trying to figure out how to perform a pin check on my card and then grab the username off of the card.

I'm using the jpcslite.dll. We had a dll that came with the card but it is not working properly. I also have a jpcslite.properties file which contains only this line:

lib.path=C:\\Documents And Settings\\username\\workspace\\Tool\\bin

I have a test java program with a main method that reads:

import com.sun.javacard.apduio.Apdu;

import com.sun.javacard.apduio.CadClientInterface;

import com.sun.javacard.apduio.CadDevice;

public static void main (String[] args) {

try {

CadClientInterface cad;

cad=CadDevice.getCadClientInstance(CadDevice.PROTOCOL_PCSC, null, null);

byte[] tempVar = cad.powerUp();

Apdu apdu = new Apdu();

cad.exchangeApdu(apdu);

}

catch (Exception e) {

e.printStackTrace();

}

}

This seems to be working ok. I get the following output to the console when I run the code:

Reader 0 : SCM Microsystems Inc. SCR33x USB Smart Card Reader 0

Before SCardEstablishContext ...

After SCardEstablishContext ...

SUCCESS ...-855572480

NativeConnect Context is ... -855572480

NativeConnect card is ... ea010000

NativeStatus card is ... ea010000

NativeTransmit card is ... ea010000

NativeTransmit_barray(): inlen 4

NativeTransmit_barray(): return code 0x0, return length 2

My question now is how to go about sending queries to the card to check the pin and get the username. I'm guessing it has to do with the exchangeApdu method. Do I need to call apdu.setDataIn()?

Also, how do I figure out which hex numbers will apply to which instructions on the card?

Thank you a ton for your help

[1844 byte] By [CDM_Ballera] at [2007-11-27 9:54:58]
# 1
Hi CDM_Baller,Does this mean that you have a card with PIN and Username already on it? And that you might use this card as identification some where else? OR do you wonder how to make an applet for doing PIN check and the deliver username in return?--
davendaa at 2007-7-13 0:25:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2

Yes, I have test cards (i have several froma bunch of different makers including oberthurand several others) that already have pins and usernames on them. I've used ActivClient software to look at the cards. The cards could get used somewhere else, but I really just want to be able to check the pin and then grab the username and thats about it.

CDM_Ballera at 2007-7-13 0:25:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3
Well, normally you communicate with the card through sending and receiving hex numbers. And if you don't know what the card want, and/or what the numbers you get in response means, you are stuck...Is it possible to get hold of the commands and responses ie. the documentation?
davendaa at 2007-7-13 0:25:03 > top of Java-index,Java Mobility Forums,Consumer and Commerce...