ElecKey Agent

The ElecKey agent functions to provide an interface to the Key system. It allows the application, via the KeyCheck library EKC3220.DLL (32-bit) and EKC6420.DLL (64-bit), to access the Key in order to check or update the license. There are two types of the agent.


·         Local Key Agent. The Local Key agent provides an interface to the Local Key, which includes Harddisk Key and USB Key (dongle). It is available in different versions: EKAG20.EXE (legacy OS), EKAG20NT.EXE (32-bit), and EKAG6420.EXE (64-bit).

·         Network Key Agent. The Network Key agent provides an interface to the Network Key via the TCP/IP based communication with the NetKey License Server. It is available in two versions: NKAG20.EXE (32-bit) and NKAG6420.EXE (64-bit).


The agent was designed to offer flexibility and ease of interface. The KeyCheck EKC3220.DLL (32-bit) and EKC6420.DLL (64-bit) can interface with the agent in either version: 32-bit (EKAG20NT.EXE/NKAG20.EXE) or 64-bit (EKAG6420.EXE/NKAG6420.EXE), if it is already running in the memory. If the agent is not yet started, EKC3220.DLL finds and loads the 32-bit agent first, if not found then the 64-bit agent. While, EKC6420.DLL finds and loads the 64-bit agent first, if not found then the 32-bit agent.


You can include either 32/64-bit agent or both with your application. The 64-bit agent would generally perform faster in run-time on 64-bit OS. However, its file size is much larger than the 32-bit agent (i.e. 14 MB compared to 1.8 MB). Basically, you should include the 32-bit agent for Win32 apps, and the 64-bit agent for Win64 apps. If your application contains both 32/64-bit executables, you should include the 64-bit agent. For .NET apps, it is recommended to include both 32/64-bit agents. If you want to include just one agent, you can include only the 32-bit agent.

Agent Startup

The ElecKey agent is automatically loaded when the protected application (as well as the NetKey License Server) is started. Based on the DDE (Dynamic Data Exchange) technology, the agent runs as a DDE server to wait for a request from the application.


By default, the agent is terminated automatically when the application is closed. Because of loading the agent, it may cause a slight delay in starting the protected application, especially on a slow computer. A solution is to let the agent running even after the application is closed. This can help to increase the speed when starting the application again later.


You can configure the agent in the KeyCheck API configuration file called KCAPI.INI. To let the agent run without termination, use any text editor to create and edit the KCAPI.INI file as follows.





The KCAPI.INI file must be placed in the same folder as the protected executable.

Agent Command Usage

The agent provides several configuration options. You can configure the agent via the agent command, for instance, to load the agent when Windows is started up. The following is the agent command usage.


Usage:  EKAG20 <Agent ID> <Startup Flag>

              EKAG20NT <Agent ID> <Startup Flag>

              EKAG6420 <Agent ID> <Startup Flag>

              NKAG20 <Agent ID> <Startup Flag>

              NKAG6420 <Agent ID> <Startup Flag>


Agent ID: The Agent ID is provided in the Integration Result dialog and the log file after ElecKey Integrator finishes protecting a program or creating an Initiate Code.


Startup Flag: Agent startup options

    0 = Run the agent until the application is closed

    1 = Run the agent without termination

    2 = Run the agent and install the agent to the Windows startup

    3 = Delete the agent from the Windows startup

    4 = Install the agent to the Windows startup

    5 = Terminate the running agent

    6 = Delete the agent from the Windows startup and then terminate the running agent


To run the agent and install the agent to the Windows startup:

EKAG20NT 0200B03FD1305A4B 2

To delete the agent from the Windows startup:

EKAG20NT 0200B03FD1305A4B 3


Note that the agent command should be run before the protected application is started. You may also include a script to run the agent command in the application setup installer.


note NOTE: Instead of using the agent command, you can install the agent to the Windows startup by editing the Windows registry and creating a new key in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Run. The key name should be the Agent ID. For example, 0200B03FD1305A4B. The value is the full path of the agent, plus the Agent ID and the startup flag 1. For example, “C:\Program Files\ABC Software\ekag20nt.exe” 0200B03FD1305A4B 1.