In this article we are going to develop a Smart Card Library that will ease the development of Smart Card Applications using the Win32 SDK and/or MFC. This assumes that you’re familiar with Win32 and MFC. The library builds upon the available support for Smart Cards in Windows by providing an Object Oriented wrapper over the WinSCard API. One advantage of using this library is the layered approach, which isolates the core API’s available to non-Win32 conformant languages like java to access this library through JNI (Java Native Interfaces). If you’ve already developed some applications using the APIs exposed by WinSCard.dll then you’ll be well aware of the complexities involved and here is an attempt to ease them.
Microsoft has provided several enhancements toward the use of PCSC conformant Smart Cards with the operating systems releases made after Windows 2000.There is available a COM wrapper and Smart Card Base Components provided as a part of this enhancements.
The heart of this Subsystem is the WinSCard.dll which exposes raw APIs for managing and accessing PCSC compliant Smart Card readers. In order to take a quick look at what it exposes, you can just use the Dependency Walker. Below is a Snapshot of the same.
Figure 1:The API exports by WinSCard.dll
There are around 60 exports from this DLL and cover most parts of the PCSC specification. Here we would try encapsulating some of the core APIs to develop an object-oriented wrapper that we can use to develop MFC applications that use Smart Cards.