Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading data from a chip
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Miscellaneous
Thread ID:
01505318
Message ID:
01505337
Views:
69
> Is there a way to somehow read a data from a chip on ID card or from chip on driver license?

Hi Zoran,

Technically it is possible either in Visual FoxPro or in .NET. Two years ago I have implemented a solution for ACOS3 smart cards.

ACOS3 Smart Card Class Library (VCX) for Visual FoxPro
http://www.news2news.com/vfp/?solution=2

Note that it is not a universal solution, but one that works with ACOS3 smart cards only. There are several smart card systems around. Two I worked with are ACOS3 and ACOS5. They differ in internal and user file structures and encryption methods. For sure you need to know exactly the smart card OS you are going to work with.

Expect to invest the most of your time NOT for solving low level issues like how to establish a connection with a card; but mainly for figuring out how the data is structured on a card. Due to encryption a simple read-write may require a bunch of interactions between a card and card reader.

Other than that a smart card solution is based on just a few Windows API functions. Here is an excerpt from my class.
PROTECTED PROCEDURE declare

	DECLARE INTEGER StringFromGUID2 IN ole32;
		STRING rguid, STRING @lpsz, INTEGER cchMax

	DECLARE LONG SCardEstablishContext IN Winscard;
		INTEGER dwScope, INTEGER pvReserved1,;
		INTEGER pvReserved2, INTEGER @phContext
	
	DECLARE LONG SCardReleaseContext IN Winscard;
		INTEGER hContext

	DECLARE LONG SCardListReaderGroups IN Winscard;
		LONG hContext, STRING @mszGroups,;
		LONG @pcchGroups

	DECLARE LONG SCardListReaders IN Winscard;
		INTEGER hContext, STRING mszGroups,;
		STRING @mszReaders, LONG @pcchReaders

	DECLARE LONG SCardListCards IN Winscard;
		INTEGER hContext, INTEGER pbAtr,;
		INTEGER rgguidInterfaces, LONG cguidInterfaceCount,;
		STRING @mszCards, LONG @pcchCards

	DECLARE LONG SCardListInterfaces IN Winscard;
		INTEGER hContext, STRING szCard,;
		STRING @pguidInterfaces, LONG @pcguidInterfaces

	DECLARE LONG SCardGetProviderId IN Winscard;
		INTEGER hContext, STRING szCard,;
		STRING @pguidProviderId

	DECLARE LONG SCardGetCardTypeProviderName IN Winscard;
		INTEGER hContext, STRING szCardName,;
		LONG dwProviderId, STRING @szProvider,;
		LONG @pcchProvider

 	DECLARE LONG SCardConnect IN Winscard;
		INTEGER hContext, STRING szReader,;
		LONG dwShareMode, LONG dwPreferredProtocols,;
		INTEGER @phCard, LONG @pdwActiveProtocol

 	DECLARE LONG SCardControl IN Winscard;
		INTEGER hCard, LONG dwControlCode,;
		STRING lpInBuffer, LONG nInBufferSize,;
		STRING @lpOutBuffer, LONG nOutBufferSize,;
		LONG @lpBytesReturned

	DECLARE LONG SCardDisconnect IN Winscard;
		INTEGER hCard, LONG dwDisposition

	DECLARE LONG SCardGetAttrib IN Winscard;
		INTEGER hCard, LONG dwAttrId,;
		STRING @pbAttr, LONG @pcbAttrLen

	DECLARE LONG SCardTransmit IN Winscard;
		INTEGER hCard, STRING pioSendPci, STRING pbSendBuffer,;
		LONG cbSendLength, INTEGER pioRecvPci,;
		STRING @pbRecvBuffer, LONG @pcbRecvLength

	DECLARE LONG SCardStatus IN Winscard;
		INTEGER hCard, STRING @szReaderName,;
		LONG @pcchReaderLen, LONG @pdwState,;
		LONG @pdwProtocol, STRING @pbAtr,;
		LONG @pcbAtrLen

ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform