Card Management System sample

The sample in the cardms folder mimics the operation of a CMS (Card Management System).

  • Create users

  • Recover users

  • Generate signing keys

  • Write in smart card

See below for how to use this sample.

Installing the PKCS #11 library

Depending on the operating system of your computer, you would need one of the following PKCS #11 libraries distributed in the etjava_90_lib.zip file.

OS

Library path in etjava_90_lib.zip

Library configuration

Windows

etjava/lib/win/x64/JNIPKCS11_64.dll

Move this file to the %windir%\system32 folder on your computer.

Linux

etjava/lib/linux/X86_64/libJNIPKCS11_64.so

Move this file to the LD_LIBRARY_PATH of your computer.

You will also need the PKCS #11 library supplied by your smart card vendor.

Compiling SampleCardMS.java

Run the following command line in the etjava/examples directory .

javac -sourcepath source -d classes -classpath ../lib/enttoolkit.jar source/com/entrust/toolkit/examples/cardms/SampleCardMS.java

Running SampleCardMS

Run the following command line in the etjava/examples directory .

java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.cardms.SampleCardMS <ca_ip> <ca_port> <user_ref> user_auth> <p11> <card_slot> <card_pin> [-create | -recover]


Parameter

Value

<ca_ip>

The IP address for the Entrust Certificate Authority.

<ca_port>

The port for accessing the Entrust Certificate Authority.

<user_ref>

The user reference number for the Entrust user being created or recovered. You can obtain this value from the PKI Administrator.

<user_auth>

The user authorization code for the Entrust user being created or recovered. You can obtain this value from the PKI Administrator.

<p11>

The path of the PKCS #11 library provided by the smart card vendor.

<slot>

The identifier of the smart card slot.

<pin>

The user's PIN for accessing the card.

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.cardms.SampleCardMS myEASM.domain.com 829 51721520 HY8Z-SLBY-GO74 tokenVendorLibrary.dll 11 Passw0rd -create
 
Initializing the Toolkit... DONE
Executing General Message transmission and generating injected key information... DONE
Executing Initialization transmission and retrieving digital identity representation... DONE
Writing the digital identity to the smart card... DONE
Executing Confirmation transmission... DONE