SCardX Manual Delphi7
SCardX Manual Delphi7
Developers Manual
Document ver.1.4
Dec. 22, 2005
All rights reserved. No parts of this work may be reproduced in any form or by any means - graphic, electronic, or
mechanical, including photocopying, recording, taping, or information storage and retrieval systems - without the
written permission of the author.
Products that are referred to in this document may be either trademarks and/or registered trademarks of the
respective owners. The publisher and the author make no claim to these trademarks.
While every precaution has been taken in the preparation of this document, the publisher and the author assume no
responsibility for errors or omissions, or for damages resulting from the use of information contained in this document
or from the use of programs and source code that may accompany it. In no event shall the publisher and the author be
liable for any loss of profit or any other commercial damage caused or alleged to have been caused directly or
indirectly by this document.
Thank You for your interest to the SCardX Easy smart card
ActiveX control!
Publisher
Please send me all your suggestions or any questions about the
SCardX Easy smart card ActiveX control via e-mail
[email protected].
SCardSOFT
Visit our web site for the latest software and specifications
updates.
h ttp :/ /ww w.s ca rd so ft. co m
in fo@ s ca rd so ft. co m
Yours,
Igor V. Kharchenko
author.
Smart Cards in the Delphi applications. Developers Manual ( Document ver.1.4, Dec. 22, 2005 ) Contents
Table of Contents
Part I About 4
1 About SCardX
...................................................................................................................................
Easy ActiveX control 4
2 Contacts ................................................................................................................................... 4
2 Your first...................................................................................................................................
application and the connection testing 16
2 New Delphi
...................................................................................................................................
project 22
3 Interface ...................................................................................................................................
functions 22
4 Events ................................................................................................................................... 24
5 Preparing...................................................................................................................................
the connection controls 27
6 Preparing...................................................................................................................................
the opened reader controls 29
7 Tray Icon................................................................................................................................... 34
8 LookUp service
................................................................................................................................... 38
9 Data ciphering
................................................................................................................................... 39
10 Card detecting
...................................................................................................................................
defaults 40
11 Configuring
...................................................................................................................................
the application startup 42
12 Configuring
...................................................................................................................................
the application shutdown 43
OnCardWait
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 82
OnConnected
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 83
OnDataSent
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 84
OnDisconnected
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 84
OnERROR... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 84
OnHistoryEvent
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 86
OnLock ... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 86
OnReaderSelected
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 87
OnReadersList
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 87
OnReaderStateChanged
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 88
OnTrayIconDblClick
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 89
OnTrayIconMenuItem
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 89
OnUnlock... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 90
Part VI Registration 91
1 Unregistered
...................................................................................................................................
version limitations 91
2 Licensing................................................................................................................................... 91
End-User ...
Licenses
... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 91
Developers
... ...Licenses
.... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 92
Custom versions
... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 93
3 Registration
...................................................................................................................................
steps 94
Step 1 : License
... ... .... ...Query
.... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 94
Step 2 : Purchasing
... ... .... ... .... ...the
.... ...
License
.... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 94
Step 3 : Certificate
... ... .... ... ....registration
... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ... .... ... .... .... ... .... ... .... ........ 94
1 About
SCardX Easy
Smart Card ActiveX control
Version 1.3
1.2 Contacts
SCardSOFT Home
Prices page
License's purchasing info page
If your development environment (IDE) supports the ActiveX technology like the MS Visual
Studio, Borland Delphi or C++ Builder or other - than the SCardX Easy may be successfully used
by your applications.
The SCardX Easy ActiveX control creates the communication channel between the parent
application and an opened smart card via the smart card service and any attached PC/SC
compatible smart card reader.
The SCardX Easy allows you to send the command data buffers into any ISO-7816 compatible
smart cards and to receive the cards' answers.
Using SCardX Easy ActiveX control you can talk with a smart card using card's "native" language -
the language of the command APDU's. It is the lowest level of work with smart cards from the PC.
Using SCardX Easy ActiveX control you can send into your cards any commands according to the
cards' specifications easy and without any limitations.
2.2 Appearance
2.2.1 States page
The "States" page is a main user interface element of the SCardX Easy ActiveX control.
There are many useful information and context pop-up menu commands on this page:
Preferences:
Miscellaneous
Device state
Device info
ATR
Protocol
Sharing mode
Card info
Error
This page has the context pop-up menu which allows you to take access to many useful
commands depending to the selected item.
This page contents the archive of the events which was occured.
Fields
Useful info:
you can hide/show this page by operating of the VisibleEventsHistory property;
you can read the Events History grid data to your application by calling the function
GetEventsHistory ;
you can clear the Events History grid data by calling the function EventsHistoryClear ;
you can lock/unlock the events logging by operating of the EventsHistoryEnabled property.
The ToolBar panel contain the controls for the data sending.
Using the ToolBar you can prepare and send into an opened smart card the control APDU's.
Or you can prepare and send into an opened smart card the unformatted data buffers.
The ToolBar may be used for testing of the smart card service connection or your device from any
temporary application because it is ready for data sending at once after adding the SCardX Easy
to your application.
If you don't need the ToolBar into your main application you can hide it easy.
Useful info:
The StatusBar is an indicator of the activity of the data exchange process between the SCardX
Easy and a smart card service.
Useful info:
The smart card service is a drivers' layer which is used by SCardX Easy for communication with a
smart card.
Each card readers' manufacturer supports its devices by its own drivers' set.
However the last versions of the Microsoft Windows OS supports its own smart card service based
on the PC/SC standard. The Microsoft PC/SC smart card service allows to any applications to work
with smart cards independent to the hardware drivers.
Today SCardX Easy supports the MS Smart Card Service (PC/SC Interface) and it works with
any of PC/SC compatible smart card readers.
The next versions of SCardX Easy will additionally support some another alternative smart card
services .
Useful info:
you can select the smart card service by operating of the SmartCardService property;
you can connect SCardX Easy to the selected service or disconnect it by operating of the
ConnectionState property;
2.3.2 Events
The SCardX Easy allows to your application to receive all possible events from the selected smart
card service:
OnHistoryEvent
OnReaderSelected
OnTrayIconDblClick
OnTrayIconMenuItem
OnCardDetected
OnCardInvalid
OnCardReady
OnCardWait
OnConnected
OnDataSent
OnDisconnected
OnReadersList
OnReaderStateChanged
Other events
OnERROR
OnLock
OnUnlock
The SCardX Easy allows to your application to send the data into a card and to receive the card
answers.
Before the data sending your application must prepare the sending data in the hexadecimal format
according to the specification of your card.
After calling both these functions returns the hexadecimal data buffer of the card answer on the
sent data.
You may analyze the card answers according to the cards' specifications.
The SCardX Easy allows to your application to use the following LookUp services:
Error LookUp : decodes any error code from it number value to the text string;
State LookUp : decodes and unpacks the readers' state code from it number value to the text
string;
The SCardX Easy allows to your application to encode and to decode the text strings using the
DES algorithm.
The SCardX Easy has its own icon in the system tray zone.
You can expand this pop-up menu by adding of your own menu items at any time.
The SCardX Easy allows you to add any counts of your own menu items.
Useful info:
you can re-create the TrayIcon's menu by calling the TrayIconMenuCreate function;
you can clear all menu items of the TrayIcon at once by calling the TrayIconMenuClear function;
you can check/uncheck the menu item by calling the TrayIconMenuItemSetChecked function;
you can enable/disable the menu item by calling the TrayIconMenuItemSetEnabled function;
you can make the menu item as a default item by calling the TrayIconMenuItemSetDefault function;
when the user clicks on the TrayIcon menu item the event OnTrayIconMenuItem occurs;
when the user twice clicks on the TrayIcon the event OnTrayIconDblClick occurs;
2.4.4 Preferences
The SCardX Easy allows you to change the preferences via its ActiveX interface.
Using the SetPref_PCSC_OnCardDetect function you can set up of the following preferences:
Miscellaneous
Using the SeparateReceivedBytes property you can set up the "Separate received HEX bytes"
parameter of the control's preferences.
Using the EventsLogging property you can set up the "Events logging" parameter of the control's
preferences.
Open the Delphi IDE main menu Component and click on the item "Import ActiveX Control..."
Select the "SCardX Easy ActiveX Control" string in the controls' list of the window "Import ActiveX"
Please do not change the class name "TSCardX_Easy" because this name is used by our Delphi7
demo application.
Define the name of the component palette "Palette Page" where Delphi will place the component
icon.
The window "Import ActiveX" will be closed and the window "Install" will be opened.
Define the components package where Delphi will insert a new component and click on the "Ok"
button.
The window "Install" will be closed and the window "Package" will be opened.
The window "Package" will be closed and the new ActiveX component will be created on the
Delphi's components palette.
You can use now the SCardX Easy ActiveX control as a Delphi component in the your
applications.
You can create the first small application for testing of the smart card service and card readers of
your PC .
Please create the new Delphi application. Drag the SCardX_Easy icon from the components
palette and drop it on the new form.
Run it.
Click on the "Service" item of the "States" page of the SCardX Easy by the right mouse button and
select the menu item "Connect ":
The SCardX Easy ActiveX control will try to connect the MS Smart Card service.
If these drivers are present on your PC the SCardX Easy ActiveX control will connect its and the
available card readers names list will be shown.
Insert the standart ISO-7816 smart card like the GSM SIM into the reader.
If the card is valid it will be opened and the info about of this card will be shown on the "States"
page.
That's all.
If you can send now the data buffers into your cards you may start to create your first smart cards
application.
If an error event will be occured during of this test it means that either the smart card service on the
your PC is not started or your devices are not works. In this case you can contact the SCard
SOFT's support service via e-mail [email protected] for detecting and removing the troubles.
The SCardX Easy setup program installs the source codes of example applications.
The default examples' path on your hard drive after control's installation is:
You can find the Delphi 7 demo application source codes on the following default path:
This demo application will be used by this Manual as a base of your first smart cards Delphi
application.
Please find it and copy its source codes to your Delphi projects workplace.
You need to control the states of the form's controls depending to the states of the connection and
to your readers' states.
For example the data sending command button must be disabled while the reader is empty.
For managing of the controls' states you need to control the values of the following three SCardX
Easy ActiveX control properties:
ConnectionState
IsLocked
IsCardReady
When one of these properties becomes changed you need enable or disable some of the form's
controls.
Button2.Enabled := (not bb) and ll; // enabled when not locked and not connected
Button3.Enabled := bb and ll; // enabled when connected and not locked
Button4.Enabled := bb and ll; // enabled when connected and not locked
ReadersList.Enabled := bb and ll; // enabled when connected and not locked
// .... any another control here
// .... any another control here
// ....
finally
EnableCardControls;
end;
end;
Button5.Enabled := bb and ll; // enabled when the card is opened and not locked
Button6.Enabled := bb and ll; // enabled when the card is opened and not locked
Button7.Enabled := bb and ll; // enabled when the card is opened and not locked
Button8.Enabled := bb and ll; // enabled when the card is opened and not locked
Button9.Enabled := bb and ll; // enabled when the card is opened and not locked
Button10.Enabled := bb and ll; // enabled when the card is opened and not locked
// .... any another control here
// .... any another control here
// ....
finally
end;
end;
OnConnected
OnDisconnected
OnLock
OnUnlock
The EnableControls function calls the EnableCardControls function automatically. But you need to
call it additionally on the following events:
OnCardWait
OnCardReady
OnReaderSelected
And additionally you need to call the EnableCardControls function each time when the active
reader name of your application will be changed. In the demo application this function additionally
calls on the ReadersList.OnChange event.
4.4 Events
How to receive the smart cards' or the service's events into your own application?
Just select the SCardX_Easy in the ObjectInspector and go to the its Events page. There are all
our control's events there. Double click on the event which you need and the Delphi will create the
source code for you automatically.
All SCardX Easy ActiveX control events are maximal informative. There are all info which you
need are present in the event's parameters.
The OnCardReady event gives you all useful information about the opened card at once:
the opened card's Reader Name;
the ATR of the opened card;
the real active Protocol of the opened card.
Any smart card application without the events are dead and unusable.
Otherwise by using the SCardX Easy ActiveX control you can add to your programs the power and
sensitivity of the professional applications.
Additionally to the specific events' tasks the demo application has special controls and procedures
for the simple visualization of all received events :
These events visualization tools are the Memo control and the AddEvent function:
It's easy! Call this function on the each occured event and you will see all received events by
looking thru the text lines into the Memo control:
Before working with smart cards we need to connect the smart card service.
Place on the form the three buttons for the connection commands and one combo box for the
readers names list like on this picture:
By clicking on the "Connect " command button we'll select the MS Smart Card service and set up
the connection state of SCardX Easy as connected:
By clicking on the "Disconnect" command button we'll close the connection and unload the driver:
the SCardX Easy loads the driver libraries and makes the connection to the selected smart
card service;
OnConnected events occurs; on this event you can enable the controls on the form by calling
the EnableControls function;
the SCardX Easy loads from the service the list of the names of the available card readers
which are attached to your PC;
OnReadersList events occurs; on this event you can receive and store the readers list;
the SCardX Easy starts to listen the devices for the changes of its states;
from now the application will receive the following readers states events:
OnReaderStateChanged
OnCardWait : on this event you can enable the controls on the form by calling the
EnableCardControls function;
OnCardDetected
OnCardInvalid
OnCardReady : on this event you can enable the controls on the form by calling the
EnableCardControls function;
OnReaderSelected : on this event you can enable the controls on the form by calling the
EnableCardControls function;
You can receive and store on the form the readers list by the two ways:
using the OnReadersList event;
using the GetReadersList function of the SCardX Easy;
The demo application uses the ReadersList combo box as a readers names' container. And
additionally the selected reader of this combo box always used as the active reader name for all
smart cards' and devices' commands.
For filling up of the ReadersList combo box by the real names of attached readers the demo
application has a function MakeReadersList:
The demo application calls the MakeReadersList automatically on the OnReadersList event:
It's easy! The SCardX Easy ActiveX control gives you the readers list as a parameter of the
OnReadersList event!
Alternatively you can receive the readers list at any time using the GetReadersList function of the
SCardX Easy. For this command the demo application has the "Refresh Readers List" button.
By clicking on the "Refresh Readers List" command button the application reloads the readers list:
finally
end;
end;
After receiving of the OnCardReady event the application may call the following functions of the
SCardX Easy ActiveX control:
ReopenReader
GetReaderInfoFmt
GetReaderInfo
GetCardInfoFmt
GetCardInfo
GetCardATR
SendCardAPDU
SendCardDATA
All these functions takes the opened reader name as a parameter and may be called after
receiving the OnCardReady event only.
By clicking on this button the application will reopens the selected card reader:
The SCardX Easy has two functions for the reader info receiving:
GetReaderInfo
GetReaderInfoFmt
The function GetReaderInfo returns the not formatted info lines like these ones:
[VENDOR INFO]
VENDOR NAME=SCM Microsystems Inc.
VENDOR IFD TYPE=CHIPDRIVE Serial
VENDOR IFD VERSION=< no info >
VENDOR IFD SERIAL NO=12639860
The function GetReaderInfoFmt returns the formatted info lines like these ones:
VENDOR INFO
VENDOR NAME .................. SCM Microsystems Inc.
VENDOR IFD TYPE .............. CHIPDRIVE Serial
VENDOR IFD VERSION ........... < no info >
VENDOR IFD SERIAL NO ......... 12639860
By clicking on the "Get Reader Info" button the application will receive the info lines :
ss:=ReadersList.Text;
if CheckBox8.Checked
then s:=SCardX_Easy. GetReaderInfoFmt (ss)
else s:=SCardX_Easy. GetReaderInfo(ss);
AddEvent ('GetReaderInfo',ReadersList.Text);
Memo.Lines.Add(s);
finally
end;
end;
The SCardX Easy has two functions for the card info receiving:
GetCardInfo
GetCardInfoFmt
The function GetCardInfo returns the not formatted info lines like these ones:
[ICC STATE]
ATR STRING=3B 79 94 00 00 59 01 01 0F 01 00 01 04 A9
ICC PRESENCE=2
ICC INTERFACE STATUS=255
ICC TYPE PER ATR=1
CURRENT IO STATE=< no info >
[PROTOCOL]
DEFAULT DATA RATE=9624
MAX DATA RATE=115484
ASYNC PROTOCOL TYPES=3
DEFAULT CLK=3580
The function GetCardInfoFmt returns the formatted info lines like these ones:
ICC STATE
ATR STRING ................... 3B 79 94 00 00 59 01 01 0F 01 00 01 04 A9
ICC PRESENCE ................. 2
ICC INTERFACE STATUS ......... 255
ICC TYPE PER ATR ............. 1
CURRENT IO STATE ............. < no info >
PROTOCOL
DEFAULT DATA RATE ............ 9624
MAX DATA RATE ................ 115484
ASYNC PROTOCOL TYPES ......... 3
DEFAULT CLK .................. 3580
By clicking on the "Get Card Info" button the application will receive the info lines :
ss:=ReadersList.Text;
if CheckBox9.Checked
then s:=SCardX_Easy. GetCardInfoFmt(ss)
else s:=SCardX_Easy. GetCardInfo(ss);
AddEvent ('GetCardInfo',ReadersList.Text);
Memo.Lines.Add(s);
finally
end;
end;
By clicking on the "Get Card ATR" button the application will receive the ATR string of the opened
card:
AddEvent ('GetCardATR',ReadersList.Text);
Memo.Lines.Add(s);
finally
end;
end;
By clicking on the "Send APDU" button the application gets the hexadecimal parts of a command
APDU according to ISO-7816 from the form's edit controls and puts its to parameters of the
SCardX Easy's function SendCardAPDU :
try
wReaderName := ReadersList.Text;
wCla := Cla.Text;
wIns := Ins.Text;
wP1 := P1.Text;
wP2 := P2.Text;
wP3 := P3.Text;
wLe := Le.Text;
wDataIn := DataIn.Text;
wSW := '';
wDataOut := '';
except on em:exception do
begin // ### ERROR HERE
ss:='';
ShowMessage(em.Message);
end;
end;
finally
if (ss>'')
then begin
SW.Text:=wSW;
DataOut.Text:=wDataOut;
end;
end;
end;
This function returns the card's response APDU data as parameters according to ISO-7816 :
the status word SW1SW2 value in the hexadecimal format; it placed in the edit control labeled
"Received SW1SW2 (Hex)";
the DataOut buffer in the hexadecimal format; it placed in the edit control labeled "Received
DataOut (Hex)"
By clicking on the "Send DATA" button the application gets the hexadecimal value of the send
buffer labeled as "Data for send (Hex)" and puts its to a parameter of the SCardX Easy's function
SendCardDATA :
try
wReaderName := ReadersList.Text;
wDataSend := DataSend.Text;
except on em:exception do
begin // ### ERROR HERE
wDataReceived:='';
ShowMessage(em.Message);
end;
end;
finally
if (wDataReceived>'')
then begin
DataReceived.Text:=wDataReceived;
end;
end;
end;
This function returns the card's answer on the sent data in the hexadecimal format. The returned
The SCardX Easy ActiveX control allows you to manage the tray icon pop-up menu items and to
receive the tray icon events.
You need to prepare the menu items list according to these rules:
each new line in the list is the new menu item template;
each menu item template consists of two parts;
the menu item ID;
the menu item caption;
the parts of the menu item template are divided by the "=" character;
if the menu item template begins with a "-" character the menus divider will be created;
Use the memo on the form for preparing of the menu items list before menu creating.
For example your menu items list may be prepared like this:
By clicking on the "Recreate TryIcon Menu" button the SCardX Easy will recreate its tray icon pop-
up menu:
checked / unchecked
enabled / disabled
default / standart
All functions for changing of the menu item's properties takes the item ID string as a parameter.
By clicking on the "Unchecked" button the SCardX Easy makes the menu item as unchecked:
By clicking on the "Enabled" button the SCardX Easy makes the menu item as enabled:
try
ww:=Edit3.Text; // ItemID
bb:=true;
SCardX_Easy. TrayIconMenuItemSetDefault (ww,bb);
finally
end;
end;
By clicking on the "Standart" button the SCardX Easy makes the menu item as standart menu
item:
The SCardX Easy allows you to decode the system error codes and the reader states codes from
its numerical values to its string descriptions.
Error LookUp
By clicking on the "Error LookUp" button the application calls the lookup function and receives the
decoded value:
ss:=SCardX_Easy. LookUpError(ww);
AddEvent ('LookUpError','');
Memo.Lines.Add('0x'+Edit1.Text+' : '+ss);
finally
end;
end;
AddEvent ('LookUpReaderState','0x'+Edit2.Text);
Memo.Lines.Add(ss);
finally
end;
end;
The SCardX Easy ActiveX control allows you to encrypt and to decrypt the text strings using the
DES algorithm.
Before using the ciphering functions you need to prepare the Key value in the hexadecimal format.
Key rules:
if you want to use ASCII symbols like the letters or numbers as a key you need to convert its
char codes to a hexadecimal format;
for example the ASCII text "MyKey123 " in the hex format is "4D794B6579313233 "
the length of the binary key always must be 8 bytes and the length of the key in the
hexadecimal format always must be 16 hex symbols!
Create the new key and place its hex value into the edit control labeled "Key (Hex)".
By clicking on the "Encrypt" button the application takes the key hex value and the text for encrypt
from the form's edit controls and calls the DES_EncryptString encrypt function:
finally
end;
end;
Encrypting example:
By clicking on the "Decrypt" button the application takes the key hex value and the encrypted hex
buffer from the form's edit controls and calls the DES_DecryptString decrypt function:
Decrypting example:
The SCardX Easy allows you to set up the card detecting defaults.
Fill up the combo box labeled "Preferred Protocol" by the following string list:
Autodetect
T0
T1
RAW
Undefined
Fill up the combo box labeled "Preferred Sharing Mode" by the following string list:
Share Reader
Exclusive Use
Direct Reader Control
Fill up the combo box labeled "Card Closing Mode" by the following string list:
Leave Card
Reset Card
Unpower Card
Eject Card
By clicking on the "Set Card Detecting Defaults" button the application sets up the preferences
values using the SetPref_PCSC_OnCardDetect function:
AutoOpen:=CheckBox12.Checked;
PreferredProtocol:= TxProtocol(ComboBox1.ItemIndex);
PreferredSharingMode:= TxSharingMode(ComboBox2.ItemIndex);
CardClosingMode:= TxCardClosingMode(ComboBox3.ItemIndex);
finally
end;
end;
All preferences changes becomes visible on the "States" page of the SCardX Easy immediately:
The application startup is a good moment for setting up the SCardX Easy's properties.
We recommend you to set up the user interface properties of the SCardX Easy like the
BorderStyle and other on the application startup.
Important! Be careful!
You must call the finalization function of the SCardX Easy on the application's shutdown!
The card command may be sent into a card as a data buffer which is formatted as a command
APDU (Application P rotocol Data Unit ).
The card's answer on each command APDU is the data buffer which is formatted as a response
APDU .
Header Body
Cla Ins P1 P2 [Lc field] [DataIn field] [Le field]
So each command is an APDU-formatted array of bytes which may be sent into a card.
The card answers on the sent command APDU by its response APDU .
Body Trailer
[DataOut field ] SW1 SW2
How it works?
For preparing of the command you need only to fill up the command APDU fields according to the
card command which you need send into the card. Where can you find the values of these fields?
You may find all necessary info about the command APDU and response APDU fields' values in
the specifications of your smart cards.
The ISO-7816 standard defines the global principles of the card's functionality only.
The real cards always differs by its available commands' set and by the values of the command
APDU fields and all cards differs by its response APDU fields values.
But all chip smart cards always receives the commands as command APDU 's and answers back
by the response APDU 's according to ISO-7816.
Please look more about the smart cards basics into the ISO-7816 standard and into the your cards'
specifications.
According to ISO-7816 any chip smart card must have the Master File (MF) named 3F00. It's the
"root directory" of the smart card's filesystem. The SIM card has the "3F00" file too.
We'll try to send to the SIM card the command SELECT MF.
According to GSM11.11 9.2.1 the command APDU for the command SELECT is defined as:
And according to GSM11.11 9.4.1 the successful respond APDU is defined as:
Cla = A0
Ins = A4
P1 = 00
P2 = 00
P3/Lc = 02
DataIn = 3F00
And after of this command APDU will be sent into the card you may receive from the card the
following response APDU :
DataOut = <none>
SW1 SW2 = 9F XX ( where XX is the length of the response data)
You can test this command using your new smart card application:
That's all.
You have prepared your first command APDU, you have sent this command into the card and you
have received from the card its answer on your command.
Congratulations!
At this moment you already have told to your SIM card - " Hello, cards World ! ".
5.1 Properties
ActivePage
BorderStyle
BorderWidth
EventsHistoryEnabled
EventsLogging
Visible
VisibleEventsHistory
VisibleStatusBar
VisibleToolBar
VisibleTrayIcon
ConnectionState
SmartCardService
SeparateReceivedBytes
5.1.1 ActivePage
Specifies what the page of SCardX Easy is on the front of the control .
apStates apEventsHistory
Description
Use the ActivePage property to determine what page is on the front of the control.
Type:
C++ : int
Basic : As Long
Delphi : Integer
Possible values:
apStates = $00000000
apEventsHistory = $00000001
Delphi syntax:
5.1.2 BorderStyle
Specifies the drawing style of the border of the SCardX Easy control.
Description
Use the BorderStyle property for setting up the control's border style.
Type:
C++ : int
Basic : As Long
Delphi : Integer
Possible values:
afbNone = $00000000
afbSingle = $00000001
afbSunken = $00000002
afbRaised = $00000003
Delphi syntax:
type TxActiveFormBorderStyle = TOleEnum;
5.1.3 BorderWidth
Description
Use the BorderWidth property for setting up the control's inner border width.
Type:
C++ : int
Basic : As Long
Delphi : Integer
Delphi syntax:
5.1.4 ConnectionState
Specifies the current state of the connection to the selected smart card service.
Description
Use the ConnectionState property for connecting or disconnecting of the selected smart card
service.
Type:
C++ : int
Basic : As Long
Delphi : Integer
Possible values:
stServiceNotConnected = $00000000
stServiceConnected = $00000001
Delphi syntax:
type TxConnectionState = TOleEnum;
5.1.5 EventsHistoryEnabled
Description
Use the EventsHistoryEnabled property for enabling or disabling the logging of events on the
Events History page.
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property EventsHistoryEnabled: WordBool;
5.1.6 EventsLogging
Description
Use the EventsLogging property to determine the control's events logging mode.
Set the EventsLogging to xLog_AllEvents if you need more detailed events log.
Type:
C++ : int
Basic : As Long
Delphi : Integer
Possible values:
xLog_AllEvents = $00000000
xLog_MostUsefulEvents = $00000001
Delphi syntax:
type TxEventsLoggingMode = TOleEnum;
5.1.7 SeparateReceivedBytes
Specifies whether the received from the card hex bytes will be separated by the space character.
Description
Set the SeparateReceivedBytes property to true if you want to receive the separated bytes like
this:
3B 79 94 00 59 01 01 0F 01
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property SeparateReceivedBytes: WordBool;
5.1.8 SmartCardService
Description
If the srv_Not_Defined value assigned in this case the SCardX Easy closes all active connections
and unloads the previous loaded service's drivers.
If the srv_MS_PCSC_SCard_Service value assigned in this case the SCardX Easy tries to find the
MS Smart Card service's libraries and loads its.
After the service will be loaded you can connect of this service by assigning the value
stServiceConnected to the ConnectionState property.
Type:
C++ : int
Basic : As Long
Delphi : Integer
Possible values:
srv_Not_Defined = $00000000
srv_MS_PCSC_SCard_Service = $00000001
Delphi syntax:
type TxSCardService = TOleEnum;
5.1.9 Visible
Description
Set the Visible property to false if you wish to hide the control on your application.
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property Visible: WordBool;
5.1.10 VisibleEventsHistory
True False
Description
Use the VisibleEventsHistory property for showing or hiding the "Events History" panel of the
control.
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property VisibleEventsHistory: WordBool;
5.1.11 VisibleStatusBar
True False
Description
Use the VisibleStatusBar property for showing or hiding the status bar of the control.
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property VisibleStatusBar: WordBool;
5.1.12 VisibleToolBar
True False
Description
Use the VisibleToolBar property for showing or hiding the tool bar of the control.
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property VisibleToolBar: WordBool;
5.1.13 VisibleTrayIcon
True
Description
Use the VisibleTrayIcon property for showing or hiding the tray icon of the control.
Warning! You can hide the TrayIcon under the Site or Developer's License only !
Type:
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
property VisibleTrayIcon: WordBool;
5.2 Functions
EventsHistoryClear
GetEventsHistory
SetPref_PCSC_OnCardDetect
TrayIconMenuClear
TrayIconMenuCreate
TrayIconMenuItemSetChecked
TrayIconMenuItemSetDefault
TrayIconMenuItemSetEnabled
GetCardATR
GetCardInfo
GetCardInfoFmt
GetReaderInfo
GetReaderInfoFmt
GetReadersList
IsCardReady
ReopenReader
SendCardAPDU
SendCardDATA
Other functions
DES_DecryptString
DES_EncryptString
Finalize
IsLocked
LookUpError
LookUpReaderState
Version
VersionMajor
VersionMinor
5.2.1 DES_DecryptString
Arguments / parameters
KeyHEX C++ : BSTR the hex data buffer of the DES key value;
Basic : As String
( input ) Delphi : WideString the length of the binary key always must 8 bytes and
the length of the key in the hexadecimal format always
must 16 hex symbols;
EncryptedDataHEX C++ : BSTR the hex data buffer of the previously encrypted by DES
Basic : As String text string;
( input ) Delphi : WideString
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Delphi syntax:
function DES_DecryptString(var KeyHEX: WideString; var EncryptedDataHEX: WideString):
WideString;
5.2.2 DES_EncryptString
Arguments / parameters
KeyHEX C++ : BSTR the hex data buffer of the DES key value;
Basic : As String
( input ) Delphi : WideString the length of the binary key always must 8 bytes and
the length of the key in the hexadecimal format always
must 16 hex symbols;
Returns
The function returns the hex data buffer of the encrypted string.
C++ : BSTR
Basic : As String
Delphi : WideString
Delphi syntax:
function DES_EncryptString(var KeyHEX: WideString; var CryptString: WideString):
WideString;
5.2.3 EventsHistoryClear
Deletes all events messages from the grid of the "Events History" page of the control.
Arguments / parameters
<none>
Returns
<none>
Delphi syntax:
procedure EventsHistoryClear;
5.2.4 Finalize
Arguments / parameters
<none>
Returns
<none>
Description
After calling of this function the SCardX Easy becomes unusable and ready for closing.
Delphi syntax:
procedure Finalize;
5.2.5 GetCardATR
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Delphi syntax:
function GetCardATR(var ReaderName: WideString): WideString;
5.2.6 GetCardInfo
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the strings which are divided by the line breaks symbols #13#10.
Each info line is formatted as a standart INI file like of this example:
[ICC STATE]
ATR STRING=3B 79 94 00 00 59 01 01 0F 01 00
ICC PRESENCE=2
ICC INTERFACE STATUS=255
ICC TYPE PER ATR=1
Delphi syntax:
5.2.7 GetCardInfoFmt
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the strings which are divided by the line breaks symbols #13#10.
Each info line is formatted and already prepared for displaying like of this example:
ICC STATE
ATR STRING ................... 3B 79 94 00 00 59 01 01 0F 01 00 01 04 A9
ICC PRESENCE ................. 2
ICC INTERFACE STATUS ......... 255
ICC TYPE PER ATR ............. 1
CURRENT IO STATE ............. < no info >
Delphi syntax:
function GetCardInfoFmt(var ReaderName: WideString): WideString;
5.2.8 GetEventsHistory
Returns the events history strings list from the "Events History" page.
Arguments / parameters
<none>
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the events messages from the "Events History" page which are
divided by the line breaks symbols #13#10 :
All fields in the each string are divided by the Tab character #9 .
This function may be useful for the errors localization during debugging of the remote application.
Delphi syntax:
function GetEventsHistory: WideString;
5.2.9 GetReaderInfo
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the strings which are divided by the line breaks symbols #13#10.
Each info line is formatted as a standart INI file like of this example:
[VENDOR INFO]
VENDOR NAME=SCM Microsystems Inc.
VENDOR IFD TYPE=CHIPDRIVE Serial
VENDOR IFD VERSION=< no info >
VENDOR IFD SERIAL NO=12639860
Delphi syntax:
5.2.10 GetReaderInfoFmt
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the strings which are divided by the line breaks symbols #13#10.
Each info line is formatted and already prepared for displaying like of this example:
VENDOR INFO
VENDOR NAME .................. SCM Microsystems Inc.
VENDOR IFD TYPE .............. CHIPDRIVE Serial
VENDOR IFD VERSION ........... < no info >
VENDOR IFD SERIAL NO ......... 12639860
Delphi syntax:
function GetReaderInfoFmt(var ReaderName: WideString): WideString;
5.2.11 GetReadersList
Returns the list of the smart card readers' names which are attached to your PC.
Arguments / parameters
<none>
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the readers names which are divided by the line breaks symbols
#13#10 :
AKS ifdh 0
AKS ifdh 1
SCM Microsystems Inc. CHIPDRIVE Serial 0
Delphi syntax:
function GetReadersList: WideString;
5.2.12 IsCardReady
Arguments / parameters
Returns
The function returns true or false depends to whether the card in the reader is opened.
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
function IsCardReady(var ReaderName: WideString): WordBool;
5.2.13 IsLocked
Specifies whether the SCardX Easy is locked for smart card service commands.
Arguments / parameters
<none>
Returns
The function returns true or false depends to whether the SCardX Easy is locked.
C++ : bool
Basic : As Boolean
Delphi : WordBool
Delphi syntax:
function IsLocked: WordBool;
5.2.14 LookUpError
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
You may decode any error value which you need because this function uses the system function of
the your PC operation system.
Delphi syntax:
5.2.15 LookUpReaderState
Decodes the string value of the card reader state from its numerical code.
Arguments / parameters
Returns
C++ : BSTR
Basic : As String
Delphi : WideString
Description
This function returns the list of the strings which are divided by the line breaks symbols #13#10.
Each state line is formatted as a standart INI file like of this example:
0x00000020=There is a card in the reader
0x00000100=The card in the reader is in use by one or more other applications, but may be
connected to in shared mode
Delphi syntax:
function LookUpReaderState(var StateCodeHex: WideString): WideString;
5.2.16 ReopenReader
Arguments / parameters
Returns
<none>
Delphi syntax:
procedure ReopenReader(var ReaderName: WideString);
5.2.17 SendCardAPDU
Sends the command APDU into the opened smart card and returns the card's answer as a
response APDU.
Arguments / parameters
Cla C++ : BSTR the Class hex byte of the command APDU;
Basic : As String
( input ) Delphi : WideString
Ins C++ : BSTR the Instruction hex byte of the command APDU;
Basic : As String
( input ) Delphi : WideString
P3Lc C++ : BSTR the Length hex byte of the command APDU;
Basic : As String
( input ) Delphi : WideString
DataIn C++ : BSTR the Data hex buffer of the command APDU;
Basic : As String
( input ) Delphi : WideString
SW1SW2 C++ : BSTR the Status Word ( status hex bytes 1 and 2) of the
Basic : As String response APDU;
( output ) Delphi : WideString
DataOut C++ : BSTR the Data hex buffer of the response APDU;
Basic : As String
( output ) Delphi : WideString
Returns
The function returns the complete response APDU buffer in a hexadecimal format.
C++ : BSTR
Basic : As String
Delphi : WideString
Description
Use this function for sending the command APDU's into an opened smart card and for receiving of
its response APDU's.
Delphi syntax:
function SendCardAPDU(var ReaderName: WideString; var Cla: WideString; var Ins:
WideString; var P1: WideString; var P2: WideString; var P3Lc: WideString; var Le:
WideString; var DataIn: WideString; var SW1SW2: WideString; var DataOut: WideString):
WideString;
5.2.18 SendCardDATA
Sends an unformatted data buffer into the opened card and returns the unformatted card's answer.
Arguments / parameters
Returns
The function returns an unformatted buffer of the card response data in a hexadecimal format.
C++ : BSTR
Basic : As String
Delphi : WideString
Description
Use this function for sending an unformatted data into an opened smart card.
Delphi syntax:
function SendCardDATA(var ReaderName: WideString; var SentDataBuffer: WideString):
WideString;
5.2.19 SetPref_PCSC_OnCardDetect
Sets up the card detecting defaults for using of the MS Smart Card service.
Arguments / parameters
AutoOpenReader C++ : bool determines w hether the card will be opened after
Basic : As Boolean detection;
( input ) Delphi : WordBool
PreferredProtocol C++ : int determines the preferred protocol which will be used for
Basic : As Long the card opening;
( input ) Delphi : Integer
PreferredSharingMode C++ : int determines the reader sharing mode which will be used
Basic : As Long for the card opening;
( input ) Delphi : Integer
CardClosingMode C++ : int determines the card closing mode which will be used by
Basic : As Long the command ReopenReader ;
( input ) Delphi : Integer
Returns
<none>
Description
Use this command for setting up the card detecting defaults via control's interface.
These preferences' changes becomes visible on the "States" page after calling of this function
immediately:
Possible values:
PreferredProtocol
xProto_Autodetect = $00000000
xProto_T0 = $00000001
xProto_T1 = $00000002
xProto_RAW = $00000003
xProto_Undefined = $00000004
xProto_Default = $00000005
PreferredSharingMode
xSharing_ShareReader = $00000000
xSharing_ExclusiveUse = $00000001
xSharing_DirectReaderControl = $00000002
CardClosingMode
xClosing_LeaveCard = $00000000
xClosing_ResetCard = $00000001
xClosing_UnpowerCard = $00000002
xClosing_EjectCard = $00000003
Delphi syntax:
type TxProtocol = TOleEnum;
type TxSharingMode = TOleEnum;
type TxCardClosingMode = TOleEnum;
5.2.20 TrayIconMenuClear
Arguments / parameters
<none>
Returns
<none>
Delphi syntax:
procedure TrayIconMenuClear;
5.2.21 TrayIconMenuCreate
Creates the new pop-up menu of the SCardX Easy's tray icon.
Arguments / parameters
MenuItemsList C++ : BSTR the string list of the new menu items' templates;
Basic : As String
( input ) Delphi : WideString
Returns
<none>
Description
Before calling of this function you need to prepare the menu items' list according to these rules:
all strings in this list are divided by the line breaks symbols #13#10 ;
each new line in the list is the new menu item template;
each menu item template consists of two parts;
the menu item ID ;
the menu item caption ;
these two parts of the menu item template are divided by the "=" character;
if the menu item template begins with a "-" character the menus divider will be created;
For example your menu items list may be prepared like this one:
These new menu items becomes visible into the tray icon's pop-up menu immediately after calling
of this function:
Delphi syntax:
procedure TrayIconMenuCreate(var MenuItemsList: WideString);
5.2.22 TrayIconMenuItemSetChecked
Makes the menu item of the tray icon's pop-up menu as checked or unchecked.
Arguments / parameters
ItemID C++ : BSTR the ID string of the menu item which was defined by the
Basic : As String TrayIconMenuCreate function;
( input ) Delphi : WideString
Returns
The function returns true if the menu item was found and the command was successful.
C++ : bool
Basic : As Boolean
Delphi : WordBool
Description
Use this function for marking of the created menu items as checked or unchecked:
Delphi syntax:
function TrayIconMenuItemSetChecked(var ItemID: WideString; var IsChecked: WordBool):
WordBool;
5.2.23 TrayIconMenuItemSetDefault
Makes the menu item of the tray icon's pop-up menu as default or standart.
Arguments / parameters
ItemID C++ : BSTR the ID string of the menu item which was defined by the
Basic : As String TrayIconMenuCreate function;
( input ) Delphi : WideString
Returns
The function returns true if the menu item was found and the command was successful.
C++ : bool
Basic : As Boolean
Delphi : WordBool
Description
Use this function for marking of the created menu items as default or standart:
Delphi syntax:
function TrayIconMenuItemSetDefault(var ItemID: WideString; var IsDefault: WordBool):
WordBool;
5.2.24 TrayIconMenuItemSetEnabled
Makes the menu item of the tray icon's pop-up menu as enabled or disabled.
Arguments / parameters
ItemID C++ : BSTR the ID string of the menu item which was defined by the
Basic : As String TrayIconMenuCreate function;
( input ) Delphi : WideString
Returns
The function returns true if the menu item was found and the command was successful.
C++ : bool
Basic : As Boolean
Delphi : WordBool
Description
Use this function for marking of the created menu items as enabled or disabled:
Delphi syntax:
5.2.25 Version
Arguments / parameters
<none>
Returns
The function returns the full version string like : Version 1.3
C++ : BSTR
Basic : As String
Delphi : WideString
Delphi syntax:
5.2.26 VersionMajor
Returns the major digit of the SCardX Easy ActiveX control version.
Arguments / parameters
<none>
Returns
The function returns the integer value of the major digit of the control's version.
C++ : int
Basic : As Long
Delphi : Integer
Delphi syntax:
function VersionMajor: Integer;
5.2.27 VersionMinor
Returns the minor digit of the SCardX Easy ActiveX control version.
Arguments / parameters
<none>
Returns
The function returns The integer value of the minor digit of the control's version.
C++ : int
Basic : As Long
Delphi : Integer
Delphi syntax:
5.3 Events
OnHistoryEvent
OnReaderSelected
OnTrayIconDblClick
OnTrayIconMenuItem
OnCardDetected
OnCardInvalid
OnCardReady
OnCardWait
OnConnected
OnDataSent
OnDisconnected
OnReadersList
OnReaderStateChanged
Other events
OnERROR
OnLock
OnUnlock
5.3.1 OnCardDetected
Arguments / parameters
Delphi syntax:
TSCardX_EasyOnCardDetected = procedure (ASender: TObject; var ReaderName: WideString) of
object;
5.3.2 OnCardInvalid
Occurs when the card was detected in the reader but the reader was not able to open it.
Arguments / parameters
Delphi syntax:
TSCardX_EasyOnCardInvalid = procedure (ASender: TObject; var ReaderName: WideString) of
object;
5.3.3 OnCardReady
Occurs when the card was detected and successfully opened in the reader.
Arguments / parameters
ProtocolValue C++ : int the real active protocol code of an opened card;
Basic : As Long
( output ) Delphi : Integer
Protocol C++ : BSTR the real active protocol name of an opened card;
Basic : As String
( output ) Delphi : WideString
Delphi syntax:
TSCardX_EasyOnCardReady = procedure (ASender: TObject; var ReaderName: WideString; var
ATR: WideString; var ProtocolValue: Integer; var Protocol: WideString) of object;
5.3.4 OnCardWait
Arguments / parameters
Delphi syntax:
TSCardX_EasyOnCardWait = procedure (ASender: TObject; var ReaderName: WideString) of
object;
5.3.5 OnConnected
Occurs when the smart card service was successfully connected by SCardX Easy.
Arguments / parameters
Possible values:
srv_MS_PCSC_SCard_Service = $00000001
Delphi syntax:
5.3.6 OnDataSent
Occurs when the data was successfully sent into the opened smart card.
Arguments / parameters
Delphi syntax:
TSCardX_EasyOnDataSent = procedure (ASender: TObject; var ReaderName: WideString; var
SentDataBuffer: WideString; var ReceivedDataBuffer: WideString) of object;
5.3.7 OnDisconnected
Arguments / parameters
<none>
Delphi syntax:
TNotifyEvent = procedure(Sender: TObject) of object;
5.3.8 OnERROR
Arguments / parameters
ErrorSource C++ : BSTR the source where an error was detected by SCardX Easy;
Basic : As String
( output ) Delphi : WideString
Delphi syntax:
5.3.9 OnHistoryEvent
Occurs when the new event was added into the events grid of the "Events History" page.
Arguments / parameters
Description
All parameters of this event are equal to the columns values of the events grid of the "Events
History" page.
Delphi syntax:
TSCardX_EasyOnHistoryEvent = procedure(ASender: TObject; var EventID: Integer; var
EventSource: WideString; var EventBody: WideString; var EventValue: WideString; var
EventTime: WideString) of object;
5.3.10 OnLock
Occurs when the communication data exchange between the SCardX Easy and smart card
service is active.
Arguments / parameters
Message C++ : BSTR the string message about the current active operation;
Basic : As String
( output ) Delphi : WideString
Delphi syntax:
TSCardX_EasyOnLock = procedure(ASender: TObject; var Message: WideString) of object;
5.3.11 OnReaderSelected
Occurs when the user has selected the reader on the "States" page by mouse clicking on its item.
Arguments / parameters
Delphi syntax:
5.3.12 OnReadersList
Occurs when the SCardX Easy receives the readers list from the smart card service.
Arguments / parameters
ReadersList C++ : BSTR the list of the readers names which are divided by the line
Basic : As String breaks symbols #13#10 ;
( output ) Delphi : WideString
Delphi syntax:
TSCardX_EasyOnReadersList = procedure(ASender: TObject; var ReadersList: WideString) of
object;
5.3.13 OnReaderStateChanged
Arguments / parameters
ReaderStateLookup C++ : BSTR the decoded new reader state string list; the strings are
Basic : As String divided by the line breaks symbols #13#10 ;
( output ) Delphi : WideString
Delphi syntax:
TSCardX_EasyOnReaderStateChanged = procedure(ASender: TObject; var ReaderName:
WideString; var ReaderState: Integer; var ReaderStateHex: WideString; var
ReaderStateLookup: WideString) of object;
5.3.14 OnTrayIconDblClick
Occurs when the user double clicks on the tray icon of the SCardX Easy.
Arguments / parameters
<none>
Delphi syntax:
TNotifyEvent = procedure(Sender: TObject) of object;
5.3.15 OnTrayIconMenuItem
Occurs when the user clicks on the menu item of the tray icon's pop-up menu.
Arguments / parameters
Delphi syntax:
TSCardX_EasyOnTrayIconMenuItem = procedure(ASender: TObject; var ItemID: WideString; var
IsChecked: WordBool; var IsEnabled: WordBool; var IsDefault: WordBool; var Caption:
WideString) of object;
5.3.16 OnUnlock
Occurs when the communication data exchange between the SCardX Easy and smart card
service was done and the control becomes ready for a new command.
Arguments / parameters
<none>
Delphi syntax:
TNotifyEvent = procedure(Sender: TObject) of object;
6 Registration
Unregistered version of a SCardX Easy ActiveX control works as a demo version only.
1. your program can send only from 7 up to 10 commands to a smart card per each SCardX Easy
start;
2. the SCardX Easy shows unregistered version's reminders in the following areas:
in the License info item of the "States" page;
in the hint of the tray icon;
in the balloon of the tray icon;
3. you can't to hide the tray icon;
4. you may not contact the SCardX Easy support service;
6.2 Licensing
6.2.1 End-User Licenses
If you don't plan to re-distribute SCardX Easy ActiveX control in this case you may purchase one of
our End-User Licenses:
Licences Prices
Purchase the Personal License
Purchase the Site License
You may create your own applications using SCardX Easy ActiveX control and to use its by
yourself unlimited:
license owner may create and unlimited use his own applications which are based on the SCardX Easy
ActiveX control for his own personal tasks only;
any re-distributions are not allowed;
to unblock your copy of the SCardX Easy ActiveX control by your own Registration Certificate;
to upgrade the new versions of the SCardX Easy ActiveX control for only 50% of the base price of the
Personal License;
to contact our support service for any questions about the SCardX Easy ActiveX control functionality
or about the smart cards basics;
By purchasing of this license you grants the SCardX Easy ActiveX control and all smart cards
applications which are based on this ActiveX to all your developers and to all your company's
staff at once.
For example SCardX Easy ActiveX control may be used by your corporate intranet smart cards
oriented web site or by others your corporate smart cards applications:
anybody may use the applications which are based on the SCardX Easy ActiveX control at the any of
computers of a company which is an owner of this license;
any re-distributions are not allowed;
to unblock your copy of the SCardX Easy ActiveX control by your own Registration Certificate;
to upgrade the new versions of the SCardX Easy ActiveX control for only 50% of the base price of the
Site License;
to request the custom setup packs of the SCardX Easy ActiveX control like the web installation for
free;
to request the custom builds of the SCardX Easy ActiveX control according to your tasks; it may cost
more depending on the requested functionality;
to contact our support service for any questions about the SCardX Easy ActiveX control functionality
or about the smart cards basics;
You may unlimited re-distribute SCardX Easy ActiveX control as a part of your own software
solutions. In this case you may purchase one of our Developer's Licenses:
Licences Prices
Any developer(s) may create applications using SCardX Easy ActiveX control and the licence
owner may sale these applications unlimited without any additional payments to SCardSOFT:
license owner may create, unlimited use and unlimited distribute the applications which are based
on the SCardX Easy ActiveX control;
re-distribution of SCardX Easy ActiveX control allowed as a part of license owner's software without
any additional payments to SCardSOFT;
all rights on the SCardX Easy ActiveX control are reserved by its author;
Developers License SC
Unlimited re-distribution with source codes included
Any developer(s) may create applications using SCardX Easy ActiveX control and the licence
owner may sale these applications unlimited without any additional payments to SCardSOFT:
license owner may create, unlimited use and unlimited distribute the applications which are based
on the SCardX Easy ActiveX control;
re-distribution of SCardX Easy ActiveX control allowed as a part of license owner's software without
any additional payments to SCardSOFT;
all rights on the SCardX Easy ActiveX control are reserved by its author;
Any developer(s) may create applications using SCardX Easy ActiveX control and the licence
owner may sale these applications unlimited without any additional payments to SCardSOFT:
license owner may create, unlimited use and unlimited distribute the applications which are based on
the SCardX Easy ActiveX control;
re-distribution of SCardX Easy ActiveX control allowed as a part of license owner's software without
any additional payments to SCardSOFT;
all rights on the SCardX Easy ActiveX control are reserved by its author;
full source codes of SCardX Easy ActiveX control are included except of our shareware security
subsystem;
no copyright limitations are present; the control may be re-distributed without our copyright
information visible;
Please be ready to support us additionally, in the case if it will be necessary, by the following:
a device(s) which will be used by an ordered software;
smart cards which will be used by an ordered software;
a device(s) and cards specification(s);
Terms
Our terms of a software creating are from two weeks up to some month depend on the requested
functionality.
How to order?
Please read in details how to order a custom software versions on our web site .
Run the program "SCardX Easy Control Center " from the start menu and make the following:
We will send you your own Registration Certificate after receiving of your money and after receiving
of your License Query during a one working day.
Your payment will be processed by the Share-It! (Germany) internet payments' service on the
highest security level via a secure SSL connection.
Licences Prices
Purchase the License just now
We will send you your own Registration Certificate after receiving of your money and after receiving
of your License Query during a one working day.
Copy the text of the Registration Certificate from the received our letter into a memory by "Copy "
command.
Run the program "SCardX Easy Control Center " from the start menu and make the following:
-B- -F-
BorderStyle property 49 Finalize example 43
BorderWidth property 49 Finalize function 60
First application : "Hello cards World !" 43
-C- First application : Application shutdown 43
First application : Application startup 42
Card Closing Mode example 40 First application : Card detecting defaults 40
Card detecting defaults example 40 First application : Connection controls 27
Card detecting defaults setting up 72 First application : Data ciphering 39
Card Info example 29 First application : Events 24
Card Info receiving 61 First application : Interface functions 22
Card Info receiving formatted 61 First application : LookUp 38
Card state checking 66 First application : New Project 22
Clearing the Events History 59 First application : Opened reader controls 29
Command APDU 43 First application : Tray Icon 34
Command APDU sending 69 First start 16
Command APDU sending example 29 Functions list 57
Connecting the service 51
Connection example 27
Connection testing 16 -G-
ConnectionState property 51 GetCardATR function 60
Contacts 4 GetCardInfo function 61
GetCardInfoFmt function 61
-D- GetEventsHistory function 63
GetReaderInfo function 64
Delphi component registration 14 GetReaderInfoFmt function 64
Delphi components palette 14 GetReadersList function 65
Demo Application 21 GSM11.11 43
DES decoding and encoding example 39
-V-
Version function 78
Version Major digit receiving 78
Version Minor digit receiving 79
Version string receiving 78
VersionMajor function 78
VersionMinor function 79
Visible property 53
VisibleEventsHistory property 54
VisibleStatusBar property 55
VisibleToolBar property 55
VisibleTrayIcon property 56