80096503-001-E ID TECH SecureMag OPOS User's Manual
80096503-001-E ID TECH SecureMag OPOS User's Manual
SecureMag
Encrypted Magstripe Reader
OPOS Reference Guide
80096503-001
Rev E. 3/10/14
ID Technologies, Inc.
10721 Walker Street, Cypress CA 90630 Voice: (714) 761-6368 Fax: (714) 761-8880
Date
Description
By
10/07/2009
Initial Release
JW
12/27/2010
JW
1/31/2011
JW
1/18/2012
JW
3/10/2014
CH
Table of Contents
1.
2.
2.1.
2.2.
2.3.
3.
3.1.
3.2.
3.3.
4.
Description ................................................................................................................................ 6
Methods, Properties and Events of SecureMag ........................................................................ 8
Methods of MSR .................................................................................................................. 8
Properties of MSR .............................................................................................................. 13
Events of MSR ................................................................................................................... 24
Programming Examples .......................................................................................................... 26
Visual C++ 6.0 Programming Example .............................................................................. 26
Visual Basic 6.0 Programming Example ............................................................................ 28
Visual Studio 2005/2008 C# Programming Example ......................................................... 31
Result Code/Error Code List ................................................................................................... 34
1. Description
The documentation describes the properties, methods, and events of the ID TECH
SecureMag MSR OPOS component. The component includes two parts: a Control
Object running on the upper level, which is an ActiveX control, and a Service Control
running on the lower level, which is an OLE automation server. The properties,
methods, and events are exposed by the Control Object. When the Control Object is
imported into your project as an ActiveX control, you will see all the properties,
methods, and events.
For different interface devices, OPOS drivers may be different. For PS/2 keyboard or
USB HID Keyboard interfaces device, the standard keyboard should not be pressed
when swiping cards, otherwise the card data will be wrong , MSR OPOS Driver will
display a warning dialog and the data will be discarded.
The USB HID Keyboard interfaces device cant support hot plug when OPOS driver
is in the Open state. If you have already pulled out the device in Open state, close
driver and reopen can use again.
For keyboard interface MSR device, the OPOS supports only one keyboard MSR
device (one PS2 device or one USBKB device) for use on a computer. In other words:
at the same time, the OPOS only allows to connect one keyboard MSR device.
In Windows8.1, you should connect the device with PC before you run setup.exe.
Once you plug the device into another port, you should run DriverRollback.bat as
administrator which you can find in xxxx\ID TECH\MagSwipe\USB HID OPOS
MagSwipe Driver, xxxx means the program installation directory. Usually the
directory is C:\Program files\ID TECH\MagSwipe\USB HID OPOS MagSwipe
Driver
2. Special Settings
There is some special setting regarding customer request that change the action of OPOS.
1. Registry Settings:
[HKEY_LOCAL_MACHINE\Software\OLEforRetail\ServiceOPOS\MSR\IDTECH_SECUREMAG_USBHID]
@="IDTechMMII.USBHID"
DebugOnOff=dword:00000000
Registry description:
DebugOnOff = dword:0
3. Target Device:
ID TECH SecureMag
RS232, USB-CDC, USB-HID, USB-KB, PS/2 KB interface
6
Platform:
Microsoft Windows 8.1 32bit, Windows 8 32bit, Windows 7 32bit,Vista 32bit, XP 32bit,
Microsoft Windows 8.1 64bit, Windows 8 64bit, Windows 7 64bit,Vista 64bit.
Service Object and Control Object:
Control Object Version:1.13.001
4. Silent Install:
Copy the silent install script to the directory of setup.exe file. Open a command promote windows
and change to the directory of setup.exe file:
Install: setup.exe /s /f1./setup.iss.install, or
Install: setup.exe /s /f1./setup.iss.install_x64 for 64bit OS,
Restart OS.
Uninstall: setup.exe /s /f1./setup.iss.uninstall, restart OS.
Note: There should not be any other software installed with MSR Keyboard filter driver, when to
use silent install script.
IDTECH_SECUREMAG_RS232
IDTECH_ SECUREMAG _USBCDC
IDTECH_ SECUREMAG _USBHID
IDTECH_ SECUREMAG _USBKB
IDTECH_ SECUREMAG _PS/2KB
Support?
Yes
This method finds more parameters in the Windows Register Tables on key or
subkeys.
RS232 interface:
HKEY_LOCAL_MACHINE\Software\OLEforRetail\ServiceOPOS\MSR\
IDTECH_ SECUREMAG_RS232
Subkey: Connector
Key value name: COM1
Key value: "serialconn.dll"
Key value name: CONNECTOR
Key value: "COM1/baud=9600/parity=N/data=8/stop=1"
COM1 specify the serial port name, if the device is plugged in the second port, it
should be modified as "COM2".
USBCDC interface:
HKEY_LOCAL_MACHINE\Software\OLEforRetail\ServiceOPOS\MSR\
IDTECH_ SECUREMAG _USBCDC
Subkey: Connector
Key value name: CONNECTOR
Key value: "COM3/baud=9600/parity=N/data=8/stop=1"
8
COM3 specify the serial port name, if the device is plugged in the second port, it
should modified as "COM2". The rest settings should be right defined according
to the settings of the reader.
Key value Name: COM3, this name should be same the first field of
CONNECTOR key value. The field is separated by "/". So, if the reader is
changed to other port, this key value is needed modified also.
USBHID interface:
HKEY_LOCAL_MACHINE\Software\OLEforRetail\ServiceOPOS\MSR\
IDTECH_ SECUREMAG _USBHID
Subkey: Connector
Key value name: USBHID
Key value: "usbhidConn.dll"
Key value name: CONNECTOR
Key value: "USBHID/0acd/2010"
USB HID KB interface:
HKEY_LOCAL_MACHINE\Software\OLEforRetail\ServiceOPOS\MSR\
IDTECH_ SECUREMAG _USBKB
Subkey: Connector:
Key value name: CONNECTOR
Key value: USBKB/0acd/2030
First field USBHID specify the type of the connector. 0acd is the USB device
vendor ID, 2030 is the reader product ID.
Key value name: USBKB
Key value: usbkbConnector.dll
PS2 KB interface:
HKEY_LOCAL_MACHINE\Software\OLEforRetail\ServiceOPOS\MSR\
IDTECH_ SECUREMAG _PS/2KB
Subkey: Connector:
Key value name: CONNECTOR
Key value: PS2
Key value name: PS2
Key value: PS2Conn.dll
2) ClaimDevice
Added in Release 1.5
Syntax
LONG ClaimDevice (LONG Timeout);
Remarks Call this method to request exclusive access to the device. Many devices
require an application to claim them before they can be used. Release 1.0 1.4 In
releases prior to 1.5, this method is named Claim.
9
Support?
Yes
3) CheckHealth
Syntax
LONG CheckHealth (LONG Level);
Remarks Called to test the state of a device.
Support? Yes
Description When select CH_INTERNAL, check the SO response, if not it tells that
there is something wrong with the device. CheckHealthText property will be Internal
HCheck: Successful
When select CH_EXTERNAL, SO will return the firmware version of the SecureMag
device, if reading the firmware version is successful. CheckHealthText property will
be External HCheck: Successful + firmware version information. If Not
Responding, CheckHealthText property will be External HCheck: Not Responding.
When select CH_INTERACTIVE , SO will display a dialog , which include firmware
version and swiping card . And it can display the Real data of the card, include Start
Sentinel and End Sentinel. CheckHealthText property will show External HCheck::
HCheck: Complete, after the dialog is closed.
4) ClearInput
Syntax
LONG ClearInput ();
Remarks Called to clear all device input that has been buffered.
Support? Yes
5) DirectIO
Syntax
LONG DirectIO (LONG Command, LONG* pData, BSTR* pString);
Remarks
Call to communicate directly with the Service Object.
Support? No
Description In the current, it implemented incompletely. We will improve it in the
next release.
6) ReleaseDevice
Added in Release 1.5
Syntax
LONG ReleaseDevice ();
Remarks Call this method to release exclusive access to the device.
Release 1.0 1.4
In releases prior to 1.5, this method is named Release.
Support? Yes
7) Close
Syntax
Remarks
Support?
from the device. The application then typically passes this token to
another entity that has special knowledge of a shared secret and is able to
create a proper response token. This response token is then passed as the
response parameter to this method and the service uses it to validate the
authentication request. If this method succeeds, the device enters the
authenticated state and the service sets the DeviceAuthenticated property
to true.
For SecureMag:
The response needs to be 16 bytes in length. And it should be transmitted
as a Hex string. Example, 0xAB 0x00 0x09 is converted to "AB0009".
Support?
NO
Yes
16) DeauthenticateDevice
Syntax
long DeauthenticateDevice (LPCTSTR response)
Remarks This method is used to deauthenticate a device that is currently in the
authenticated state (DeviceAuthenticated = true). The token is typically
generated by passing the challenge retrieved from the
retrieveDeviceAuthenticationData method to an entity that has special
knowledge of a shared secret. If this method succeeds the service sets
DeviceAuthenticated to false and enqueues a StatusUpdateEvent with
status value set to MSR_SUE_DEVICE_DEAUTHENTICATED.
For SecureMag:
The response needs to be 16 bytes (when Encryption Algorithm is 3DES)
or 8 bytes (when Encryption Algorithm is AES) in length. And it should
be transmitted as a Hex string. Example, 0xAB 0x00 0x09 is converted
to "AB0009".
Support?
NO
Yes
17) RetrieveCardProperty
Syntax
long RetrieveCardProperty (BSTR Name, BSTR *Value)
Remarks Retrieves the value of specific parsed properties from the
last card swiped.
Support? Yes
12
18) RetrieveDeviceAuthenticationData
Syntax
long RetrieveDeviceAuthenticationData (LPCTSTR challenge)
Remarks Applications call this method to retrieve a challenge token that will
subsequently be used to generate response tokens that will be passed to
the authenticateDevice and deauthenticateDevice methods. The
challenge token is typically sent to another entity that has special
knowledge of a shared secret that is required to generate the proper
response token(s).
For SecureMag:
The challenge is always 26 bytes in length. And it will be transmitted as
a Hex string. Example, 0xAB 0x00 0x09 is converted to "AB0009".
Support?
NO
Yes
19) UpdateKey
Syntax
long UpdateKey (BSTR Key, BSTR KeyName)
Remarks Provides a new encryption key to the device. It is used only for those
encryption algorithms in which new key values are sent to the terminal
as a field in standard messages from the host.
For SecureMag:
KeyName can be set any value. The Key need be 80 bytes in length. And
it should be transmitted as a Hex string. Example, 0xAB 0x00 0x09 is
converted to "AB0009".
Support?
NO
Yes
13
Property Group1---Description
Name
Type
Mutability
Use
Description
Support?
Yes
After
String
DeviceControlDescri
read-only
--
ption
int32
DeviceControlVersio
read-only
--
Yes
number.
n
DeviceServiceDescrip
String
read-only
open
Yes
tion
company that
produced it
DeviceServiceVersion
int32
read-only
open
Yes
number.
PhysicalDeviceDescri
string
read-only
open
Yes
ption
PhysicalDeviceName
string
read-only
open
Yes
Property Group2---Control
Name
Type
Mutability
Use
Description
Support?
Yes
After
Claimed
Boolean
read-only
open
It
Boolean
read-write
open
Yes
Boolean
read-write
open&
claim
14
Yes
boolean
read-write
open
Yes
It is initialized to
boolean
read-write
open
Yes
It is initialized to
int32
read-only
open
No
int32
read-write
open
No
is initialized to
OPOS_PN_DISABLED by the
Open method.
PowerState
int32
read-only
open
No
It seems that
int32
Read-only
--
Yes
int32
Read-only
open
Yes
string
read-only
open
15
Yes
Type
Mutability
Use
Description
Support?
If TRUE, SecureMag
Yes
After
CapISO
boolean
read-only
open
boolean
read-only
open
If TRUE, SecureMag
Yes
boolean
read-only
open
If TRUE, SecureMag
Yes
boolean
read-only
open
If TRUE, SecureMag is
Yes
boolean
read-write
open
Yes
boolean
read-write
open
Yes
If
DecodeData=FALSE,
ParseDecodeData must
be false.
TransmitSentinels
boolean
read-write
open
If TRUE, the
Track1Data,
16
Yes
int32
read-write
open
Yes
int32
Read-write
open
Yes
to report via
ErrorEvents. This
property has one of the
following values:
MSR_ERT_CARD or
MSF_ERT_TRACK
Property Group4---TrackData
Name
Type
Mutability
Use
Description
Support?
Yes
After
Track1Data
binary
read-only
open
If
binary
read-only
open
ata
It may be NULL
when:
1) The field was not included
in the track data obtained, or,
2) The track data format was
not supported, 3)
17
Yes
binary
read-only
open
Yes
If
binary
read-only
open
Yes
ata
It may be NULL
when:
1) The field was not included
in the track data obtained, or,
2) The track data format was
not supported, 3)
ParseDecodeData is false.
Track3Data
binary
read-only
open
Yes
binary
read-only
open
No
binary
read-only
Open
18
Yes
int32
read-only
Open
Yes
Length
encrypted.
Track2EncryptedData
binary
read-only
Open
Yes
int32
read-only
Open
Yes
Length
encrypted.
Track3EncryptedData
binary
read-only
Open
Yes
int32
read-only
Open
Length
encrypted.
19
Yes
binary
read-only
Open
No
binary
read-only
Open
No
Length
encrypted.
AdditionalSecurityInf
binary
read-only
Open
Holds additional
Yes
security/encryption
ormation
information when a
DataEvent is delivered. For
example DUKPT sequence
number in it.
This data is always 10 bytes
in length. And it will be
transmitted as a Hex string.
Example, 0xAB 0x00 0x09 is
converted to "AB0009".
CardAuthenticationD
binary
read-only
Open
No
information when a
ata
DataEvent is delivered.
CardAuthenticationD
int32
read-only
Open
No
CapCardAuthentication is an
ataLength
empty string.
DeviceAuthenticated
CardType
boolean
string
read-only
read-only
Open
No
&
--Secure
Claim
Mag
&
v3.24
Enabl
device is enabled.
MSR_SUE_DEVICE_AUTH
Yes
ENTICATED or
--Other
MSR_SUE_DEVICE_DEAU
Firmware
THENTICATED.
Version
Yes
open
string
read-only
open
Yes
string
read-only
open
20
Yes
Property Group5---ParsedData
Name
Type
Mutability
Use
Description
Support?
Yes
After
AccountNumber
string
read-only
Open
string
read-only
Open
Yes
Others
string
read-only
Open
Yes
AccountNumber.
MiddleInitial
string
read-only
Open
Yes
Others
string
read-only
Open
Yes
AccountNumber.
Title
string
read-only
Open
Yes
string
read-only
Open
Yes
string
read-only
Open
21
Yes
Others
Type
Mutability
Use
Expected Result
After
CapStatisticsReporting
boolean
read-write
Open
Test
Result
No
Bolean
read-write
Open
No
XML statistics
Property Group7---Firmware
Name
Type
Mutability
Use
Expected Result
After
CapCompareFirmware
boolean
read-write
Open
Result
If true ,the SO can compare the
No
Firmware version
Version
CapUpdateFirmware
Test
boolean
read-write
Open
No
Int32
Read_only
Open
No
Int32
Read_only
Open
No
Int32
Read-Write
Open
No
Int32
Read_only
Open
22
Yes
Int32
Read-Write
hm
Open
&
Claim
Yes
boolean
Read_only
Open
Yes
track data.
CapCardAuthenticatio
string
Read_only
Open
No
Int32
Read_only
Open
on
No
--Secure
service.
Mag
MSR_DA_NOT_SUPPORTE
v3.24
Yes
MSR_DA_OPTIONAL: The
--Other
Firmware
Version.
require it.
MSR_DA_REQUIRED:The
service requires device
authentication.
DeviceAuthenticationP
Int32
Read_only
Open
rotocol
No
--Secure
device. MSR_AP_NONE:The
Mag
v3.24
authentication.
23
Yes
--Other
Firmware
Version.
WriteCardType
string
Read-Write
Open
No
Byte2
Byte1
Byte0
Track 4
Track 3
Track 2
Track 1
Remarks Fired when an error is detected and the Controls State transitions into the error state.
NOTICE: The error type is only one E_FAILURE (Other or general error) while any error is
raised from reading card of SecureMag device. Because the SecureMag hardware cannot support
discerning wrong type.
Support?
Yes
4) StatusUpdate Event
Syntax
void StatusUpdateEvent (LONG Status);
The Status parameter is for device class-specific data, describing the type of status change.
Remarks
Fired when a Control needs to alert the application of a device status change.
Note
The SecureMag hardware cannot support the notification of power status change.
Support?
Yes
Description
SecureMag.
It is not implemented by the SO for the power status cannot be inquired from the
25
6. Programming Examples
There are three simple programming simple examples provided in this section
including VC++6.0, VB6.0, and VS2005/2008 C#. The examples include basic
operations and event handling.
In general, there are two steps to work with the OPOS control object:
1. Insert the OPOS Control Object (CO) into the project
2. Add an event handle
6.1. Visual C++ 6.0 Programming Example
Programming Environment:
Windows XP Pro, Visual C++ 6.0, OPOS CO 1.13. ID TECH SO 1.13.307
1. Download the OPOS driver and demo from the IDTECH website
www.idtechproducts.com. Install the driver and make sure the OPOS demo is
functioning.
2. In Visual C++ 6.0, create a Dialog Based MFC application using MFC
Application Wizard with ActiveX supports.
3. Go to Project Add to Project Components and Controls. From the
Registered ActiveX Controls folder, select OPOS MSR Control 1.13.001, and
insert this ActiveX control into the project. An icon for OPOS MSR will be added
to the Controls toolbar.
26
7. Create a button on the form and add the following initialization code:
void CMfc_diagDlg::OnButton1()
{
if (m_msr.Open("IDTECH_SECUREMAG_USBKB") == 0)
//0 is OPOS_SUCCESS
//" IDTECH_SECUREMAG_PS/2KB" for ps2 interface SecureMag device.
//" IDTECH_MMII_USBKB" for USBKB interface MiniMag2 device.
//" IDTECH_MMII_PS/2KB" for ps2 interface MiniMag2 device.
27
9. Compile and run the program. Compile and run the program. Click on Button1
to initialize the reader and swipe a card. Track 1 data will show up in a message
box.
28
3. Add an OPOS MSR control to the form. Double click on the control to add
DataEvent handle.
29
6. Run program and swipe a card. The track 1 data will show up in a message box.
30
3. Add OPOS MSR Control to Form1. Double click on the OPOS MSR Control
to add DataEvent handler code. Notice that the device name might need to be changed
for different interface.
31
32
33
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
LONG
OPOS_SUCCESS
OPOS_E_CLOSED
OPOS_E_CLAIMED
OPOS_E_NOTCLAIMED
OPOS_E_NOSERVICE
OPOS_E_DISABLED
OPOS_E_ILLEGAL
OPOS_E_NOHARDWARE
OPOS_E_OFFLINE
OPOS_E_NOEXIST
OPOS_E_EXISTS
OPOS_E_FAILURE
OPOS_E_TIMEOUT
OPOS_E_BUSY
OPOS_E_EXTENDED
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
34
0;
101;
102;
103;
104;
105;
106;
107;
108;
109;
110;
111;
112;
113;
114;