You are on page 1of 2

This document describes how to use the TESTCAC_BSI test program to exercise the

Datakey BSI middleware.

The TESTCAC_BSI program is supplied as a Visual C++ 6.0 workspace and project.
After loading the workspace and building it, either the debug version or the
release version may be used to test the middleware.

The output of the test program is sent to a DOS window, which will disappear
immediately upon completion of the test program if you aren't running from an
existing DOS window. When using Visual Studio to run the debug version of the
program, a breakpoint stops execution just before the test programs exits -- this
is helpful in viewing the text in the DOS window before it disappears.

The test program tests the CAC BSI API.

The test program will ask for PIN entry two times: first to test the BSI API PIN
changing function, and second to test the BSI API read/write functions.

IMPORTANT:
The last section of the test program (testing the BSI API read/write functions)
will erase the data stored in the applet with AID_GC_USERCREDENTIALS =
"A00000007902FD". The test program does not restore the data in the applet, so any
data in the applet will be permanently lost. If you want to keep that data, do not
run the test program as-is.

When running the test program, output to the console will appear similar to the
following:

The BSI API PIN change test follows. The test program asks for a PIN entry from
the keyboard:

--BSI PIN change test--


-- working with AID_ID = "A0000000790300"
gscBsiUtilCardConnect(): 0x128c
gscBsiUtilGetVersion(): "1.0.0",6
Enter PIN:

After you enter the correct 6-8 digit numerical PIN, the test program exercises the
BSI API and displays something similar to the following:

gscBsiUtilAcquireContext(0x128c,"A0000000790300",14,"77777777": OK
DK_XSI_UtilChangePIN(0x128c,"A0000000790300",14,"77777777","87654321": OK
gscBsiUtilAcquireContext(0x128c,"A0000000790300",14,"87654321": OK
DK_XSI_UtilChangePIN(0x128c,"A0000000790300",14,"87654321","77777777": OK
gscBsiUtilAcquireContext(0x128c,"A0000000790300",14,"77777777": OK

The BSI API read/write test follows. The test program asks for a PIN entry from
the keyboard:

--BSI tests--
-- working with AID_GC_USERCREDENTIALS = "A00000007902FD"
-- Erases the applet Tbuffer and Vbuffer

Enter PIN:

After you enter the correct 6-8 digit numerical PIN, the test program exercises the
BSI API by clearing the applet data, creating some tags values, changing the tag
values, and finally deleting the tag values. It displays something similar to the
following:

gscBsiUtilAcquireContext(0x128c,"A00000007902FD",14,"77777777": OK
gscBsiUtilPassthru(clearTbuf): OK - APDU status = 0x9000
gscBsiUtilPassthru(clearVbuf): OK - APDU status = 0x9000
gscBsiGcDataCreate(tag=47,"Flintstone"): OK
gscBsiGcDataCreate(tag=52,"Rubble"): OK
gscBsiGcDataCreate(tag=0,"Jetsons"): OK
gscBsiGcReadValue(tag=47: "Flintstone"
gscBsiGcReadValue(tag=52: "Rubble"
gscBsiGcReadValue(tag=0: "Jetsons"
gscBsiGcUpdateValue(tag=0,"Jetsons Schmetsons"): OK
gscBsiGcUpdateValue(tag=52,"Rubble Schmubble"): OK
gscBsiGcUpdateValue(tag=47,"Flintstone Schmlintstone"): OK
gscBsiGcReadValue(tag=47: "Flintstone Schmlintstone"
gscBsiGcReadValue(tag=52: "Rubble Schmubble"
gscBsiGcReadValue(tag=0: "Jetsons Schmetsons"
gscBsiGcDataDelete(tag=52): OK
gscBsiGcReadValue(tag=47: "Flintstone Schmlintstone"
gscBsiGcReadValue(tag=52: failed (like it should) - status=0x6
gscBsiGcReadValue(tag=0: "Jetsons Schmetsons"
gscBsiGcDataDelete(tag=47): OK
gscBsiGcDataDelete(tag=0): OK
gscBsiGcReadValue(tag=47: failed (like it should) - status=0x6
gscBsiGcReadValue(tag=52: failed (like it should) - status=0x6
gscBsiGcReadValue(tag=0: failed (like it should) - status=0x6
gscBsiUtilCardDisconnect(): OK

Closing connection...

At this point the test program is finished.

You might also like