Previous Table of Contents Next


Listing 7.1 is the C header file for the Multiflex SSP API. This SSP supports both the 3K and the 8K Multiflex cards. There are some commands such as Directory, Increase Stamped, and Decrease Stamped on the 8K card that are not implemented on the 3K card due to ROM size constraints.

Listing 7.1. The C header file for the Multiflex SSP API.

/*++
Copyright (c); 1997  Schlumberger Electronic Transactions
Module Name:
     MultiflexSSP.h
Abstract:
    Header file for API for Multiflex DLL SSP
Author:
    Scott Guthery       1-September-1997
Environment:
     Win32
Revision History:
Notes:
     None
--*/
#ifndef _MULTIFLEXSSP_H_
#define _MULTIFLEXSSP_H_
extern HRESULT WINAPI AttachCard(WCHAR *wszReaderName);
extern HRESULT WINAPI DetachCard();
extern HRESULT WINAPI \
CreateCardFile(\
     WORD wFileId, \
     WORD wFileLength, \
     BYTE bFileType,\
     BYTE bInitialize, \
     BYTE bInitialStatus,\
     BYTE bRecordLength, \
     BYTE bNumberOfRecords,\
     LPBYTE pbAccessConditions, \
     LPBYTE pbAccessKeys);
extern HRESULT WINAPI \
CreateCardFileMAC(\
     WORD wFileId, \
     WORD wFileLength, \
     BYTE bFileType,\
     BYTE bInitialize, \
     BYTE bInitialStatus,\
     BYTE bRecordLength, \
     BYTE bNumberOfRecords,\
     LPBYTE bpAccessConditions, \
     LPBYTE bpAccessKeys,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI
CreateRecord(\
     LPBYTE bpInitialData, \
     BYTE bDataLength);
extern HRESULT WINAPI \
CreateRecordMAC(\
     LPBYTE bpInitialData, \
     BYTE bDataLength, \
     LPBYTE bpCryptogram);
extern HRESULT WINAPI \
DeleteCardFile(\
     WORD wFileId);
extern HRESULT WINAPI \
DeleteCardFileMAC(\
     WORD wFileId, \
     LPBYTE bpCryptogram);
extern HRESULT WINAPI
VerifyKey(\
     BYTE bKeyNumber,\
     LPBYTE bpKey,\
     BYTE bKeyLength);
extern HRESULT WINAPI \
VerifyPIN(\
     LPBYTE bpPIN);
extern HRESULT WINAPI \
ChangePIN(\
     LPBYTE bpOldPIN,\
     LPBYTE bpNewPIN);
extern HRESULT WINAPI \
UnblockPIN(\
     LPBYTE bpUnblockPIN,\
     LPBYTE bpNewPIN);
extern HRESULT WINAPI \
GetChallenge(\
     LPBYTE bpChallenge);
extern HRESULT WINAPI \
GiveChallenge(\
     LPBYTE bpChallenge);
extern HRESULT WINAPI \
InternalAuthentication(\
     BYTE bKeyNumber,\
     LPBYTE bpChallenge);
extern HRESULT WINAPI \
ExternalAuthentication(\
     BYTE bKeyNumber,\
     LPBYTE bpChallenge);
extern HRESULT WINAPI \
Invalidate();
extern HRESULT WINAPI \
InvalidateMAC(\
     LPBYTE Cryptogram);
extern HRESULT WINAPI \
Rehabilitate();
extern HRESULT WINAPI \
RehabilitateMAC(\
     LPBYTE Cryptogram);
extern HRESULT WINAPI \
SelectFile(\
     WORD wFileId);
extern HRESULT WINAPI UpdateBinary(\
     WORD wOffset, \
     LPBYTE bpData, \
     BYTE bDataLength);
extern HRESULT WINAPI UpdateBinaryMAC(\
     WORD wOffset, \
     LPBYTE bpUpdateData, \
     BYTE bDataLength,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI UpdateRecord(\
     BYTE bRecordNumber,\
     BYTE bMode, \
     LPBYTE bpData, \
     BYTE bDataLength);
extern HRESULT WINAPI UpdateRecordMAC(\
     BYTE bRecordNumber,\
     BYTE bMode, \
     LPBYTE bpUpdateData, \
     BYTE bDataLength,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI ReadBinary(\
     LPBYTE bpData, \
     WORD wOffset, \
     BYTE bDataLength);
extern HRESULT WINAPI ReadRecord(\
     LPBYTE bpData,\
     BYTE bRecordNumber,\
     BYTE bMode,\
     BYTE bDataLength);
extern HRESULT WINAPI Seek(\
     BYTE bOffset,\
     BYTE bMode, \
     LPBYTE bpPattern, \
     BYTE bPatternLength);
extern HRESULT WINAPI \
Increase(\
     DWORD dwAmount);
extern HRESULT WINAPI \
IncreaseMAC(\
     DWORD dwAmount,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI \
IncreaseStamped(\
     DWORD dwAmount);
extern HRESULT WINAPI \
IncreaseStampedMAC(\
     DWORD dwAmount,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI \
Decrease(\
     DWORD dwAmount);
extern HRESULT WINAPI \
DecreaseMAC(\
     DWORD dwAmount,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI \
DecreaseStamped(\
     DWORD dwAmount);
extern HRESULT WINAPI \
DecreaseStampedMAC(\
     DWORD dwAmount,\
     LPBYTE bpCryptogram);
extern HRESULT WINAPI \
Directory(\
     LPBYTE bpDirectory);
extern HRESULT WINAPI \
GetResponse(\
     LPBYTE bpResponse,
     BYTE bResponseLength);

extern HRESULT WINAPI GetSW(LPWORD wpSW);;
extern HRESULT WINAPI GetLr(LPDWORD dwLr);;
#endif // _MULTIFLEXSSP_H_

The Multiflex SSP itself simply surfaces all the Multiflex commands. The applications in Chapters 10, “The Smart Shopper Smart Card Program,” and 11, “The FlexCash Card: An E-commerce Smart Card Application,” use this SSP.

MULTOS

MULTOS is a general-purpose smart card operating system that evolved from the development of the Mondex e-cash card. Like the Java Card, it supports card-side programming (see Chapter 8, “Card-Side Application Programming Interfaces”), but does it in the C programming language rather than in Java. Since MULTOS is an operating system, there is no technical reason why it couldn’t run Java too, or Forth or Tcl or BASIC, for that matter.

The simplest MULTOS API is one that surfaces the native MULTOS commands, but this is not a very interesting API. The power of being able to do card-side programming is that you can build your own command set and move functionality between the host and the card much more readily and with greater ease. Since the strength of MULTOS is in its card-side programming, we will discuss it further in Chapter 8.

The application program license fee is fairly small. If you want a copy, contact Nick Habgood at nick.habgood@mondex.com and become a licensed MULTOS application developer.

The Open Card Framework

The Open Card Framework was produced by IBM in conjunction with Netscape, NCI, and Sun Microsystems around the same time as the PC/SC architecture. It is somewhat more complex than the PC/SC architecture and was designed with the use of a smart card in a network computer in mind. Since network computers have been slow in coming, the framework has suffered from a lack of actual use.

One implementation of the Open Card Framework, the IBM Java Smart Card API, was created for JavaOS-based network computers, but there are very few smart card readers available for this system.


Previous Table of Contents Next