Administering Software Activation Certificates

From InterBase

Go Up to Invoking Service Tasks with isc_service_start( )


You can use the Services API to install or remove software activation certificates. Use the cluster identifiers isc_action_svc_add_license and isc_action_svc_remove_license, respectively.

The following table lists arguments to isc_action_svc_add_license and isc_action_svc_remove_license:

Services API software activation certificate arguments
Argument Purpose Argument length Argument
value

isc_spb_lic_key

The key string identifying a software activation certificate

2 byte length + string

String

isc_spb_lic_id

The ID string for a software activation certificate (isc_action_svc_add_license only)

2 byte length + string

String

Listing Software Activation Certificates

You can use isc_service_query() with the isc_info_get_license cluster identifier to retrieve the certificate information.

See Software activation certificates for an example of retrieving the certificate information with isc_service_query().

Adding a Software Activation Certificate

To add a software activation certificate, you must specify both the certificate ID and certificate key in the respective arguments to isc_action_svc_add_license.

Removing a Software Activation Certificate

To remove a software activation certificate, you need specify only the certificate key in the respective arguments to isc_action_svc_remove_license.

Enabling Changes to Certificates

Changes to the number of simultaneous users take effect immediately.

In order for other changes to the certificates to take effect, you must stop and restart the InterBase service. There is no Services API method in the current implementation to restart the InterBase service.

You can stop and start a service on Windows hosts programmatically using the Win32 API. You must be Administrator or a member of the Power Users NT group to start or stop a service.

For example:

Restarting a Windows service with the Win32 API

SC_HANDLE service;
if (!(service = OpenService(manager, "InterBaseGuardian",
SERVICE_STARTSERVICE_STOP)))
return 1;
if (!ControlService(service, SERVICE_CONTROL_STOP, NULL)) {
CloseServiceHandle(service);
return 1;
}
if (!StartService(service, 0, NULL)) {
CloseServiceHandle(service);
return 1;
}
CloseServiceHandle(service);
return 0;

The example code above works only on Windows server platforms, and only on the host where the InterBase server runs. On non-server Windows platforms, InterBase runs as an application, and you must manually stop and restart it to cause it to read the ib_license.dat file.

On Superserver implementations of InterBase on UNIX, you must use ibmgr to shut down and restart ibserver.

Advance To: