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

