PKCS#11

JPCSC

  • MuscleCard Middleware Download
  • mkdir -p /usr/local/depot/jpcsc-0.8.0/share/doc/jpcsc
  • make
  • If you get "error: too few arguments to function 'SCardControl'," modify src/jpcsc/jpcsc.c and change line
    1039 to #if defined(WIN32) || defined(HAVE_SCARD_ATTRIBUTES) || 1.
  • $ make test
    make -C src/samples test
    make[Agenda & Notes 9-12-2006]: Entering directory `/usr2/local/src/Aladdin/jpcsc-0.8.0/src/samples'
    export LD_LIBRARY_PATH=/usr/local/lib::/opt/oracle/lib/oracle/xe/app/oracle/product/10.2.0/client/lib; /opt/jdk/bin/java -Djava.library.path="../../build/linux" -cp ../../build/java/jpcsc.jar:../../build samples.Test
    EstablishContext(): ...
    Wait for card in a certain reader ...
    Pick reader ...
    reader 0: AKS ifdh 00 00
    reader 1: Reflex USB 00 00
    Select reader (1-n): 1
    Please, insert card into reader Reflex USB 00 00 ...
    Card inserted into Reflex USB 00 00
    Card ATR is 13: 3BF29800FFC11031FE55C80315
    Connect to card Reflex USB 00 00
    Type APDU to send or q to leave: q
    make\[1\]: Leaving directory `/usr2/local/src/Aladdin/jpcsc-0.8.0/src/samples'
    
  • JPCSC Tool (make tool) Screen Shot
  • file:///usr/local/share/doc/jpcsc/api/index.html

Open Card Framework

Note: This works, but OCF appears to be dead. See JPCSC or JCOP offcard services.

OCF Installation

  • OpenCard.org Downloads
    • You'll need OpenCard Framework All-in-One. The file is installOCF.
  • This installation can be done as non-root if you create and chown the necessary files in /usr/bin and you save the config file in your home directory.
    • installOCF.sh - script to create the required files and directories.
  • Run java installOCF
    • Destination Directory: /opt/OpenCard
    • Program Folder: OpenCard (default)
    • You probably want to use PCSC readers.
    • Destination Directory for config file: /home/whatever
  • Fix ownership of files if you installed as non-root.
  • Optional: Move stuff from /usr/bin to /opt/OpenCard/usr.bin.
  • To set up your environment: . setupOCF.sh. (PB script, not attached yet)
  • You will need the opencard.properties in your current directory, or
    • [java.home]/lib/opencard.properties
    • [user.home]/.opencard.properties
    • [user.dir]/opencard.properties
    • [user.dir]/.opencard.properties

OCF To PC/SC Shim

You need libOCFPCSC to interface to the native PCSC libraries.

Testing

  • Copy OCF1.2/components/sb-demo/src/demos/samples/GetCardID.java to your working directory.
  • Comment out the line package demos.samples; line.
  • CLASSPATH=$OCF_CLASSPATH javac GetCardID.java
  • CLASSPATH=$OCF_CLASSPATH:. java GetCardID
  • $ LD_LIBRARY_PATH=/usr/local/lib CLASSPATH=$OCF_CLASSPATH:. java GetCardID
    ------------------------------------------------------------
    start use case: get a card ID
    
    Obtained the following CardID:
    
    3B F2 98 00 FF C1 10 31 FE 55 C8 03 15
    Historicals: C8 03
    as a string:
    
    
    finished use case: get a card ID
    ------------------------------------------------------------
    

JCOP

  • No labels