License Consumption

Once the license is installed, it is then consumed according to predefined functionality implemented using the Sentinel LDK Software Protection and Licensing Guide. The API offers a universal interface for working with all Sentinel protection keys, regardless of type or access method. It enables consistent interaction with both local and remote keys using the same set of functions, simplifying integration.

This section provides a step-by-step approach to implementing the Sentinel Licensing API in your code, ensuring an efficient and streamlined workflow.

Step 1: Understand the Basics

> Familiarize yourself with licensing concepts, such as protection keys, features, and sessions using the Sentinel LDK Software Protection and Licensing Guide.

>Review the Sentinel LDK API Reference and sample code for your development environment using the Sentinel LDK Software Protection and Licensing Guide.

>Understand the groupings and available functionality of the Sentinel Licensing API using the Sentinel LDK Software Protection and Licensing Guide.

Step 2: Set Up Your Environment

1.Install Sentinel LDK: Download and install Sentinel LDK, which include development libraries, tools, and documentation.

2.Fulfill Prerequisites: Ensure the Sentinel Licensing API prerequisites, described in Sentinel LDK Software Protection and Licensing Guide.are met.

3.Add API Libraries: Include the appropriate Sentinel API library in your project. For example:

On Windows: Link with hasp_windows_x86.lib or equivalent.

On Linux: Use the corresponding .so or .a file.

4.Ensure Driver Availability: Confirm that the required Sentinel LDK Run-time Environment is installed on your system.

Step 3: Identify Licensing Features

Define the licensing requirements for your application:

>What features need to be protected?

>Will you use local keys, network licenses, or both?

>Map features to Feature IDs in your license configuration.

Step 4: Add Basic API Calls to Your Code

NOTE   All the links in the following sections refer to the C language. You can find the API references for C, .NET, Java, and other supported programming languages in the Sentinel Licensing API Reference section of the Sentinel LDK documentation.

At minimum, you’ll need:

>hasp_login: Authenticate with the Sentinel protection key using a specific Feature ID.

>Your Application Logic: Implement the core functionality that requires licensing validation.

>hasp_logout: Log out from the session to release the license.

For details about the licensing API workflow, see Sentinel LDK Software Protection and Licensing Guide.

The following diagram presents a basic workflow of the APIs:

Step 5: Compile and Test

>Compile your application with the integrated API calls.

>Test your application with a valid Sentinel protection key to ensure proper functionality.

>Use API return codes to identify and resolve errors or exceptions.

Step 6: For Advanced API Capabilities

>hasp_get_sessioninfo can be used to retrieve license details for displaying to the user or making run-time decisions.

>Use hasp_encrypt and hasp_decrypt for securing sensitive data.

>Utilize hasp_read and hasp_write for storing custom data on the key.

>hasp_login_scope establishes a session with a specific Sentinel key, location, or type, offering more flexibility than hasp_login.

Step 7: Apply Additional Protection

>Use Sentinel LDK Envelope to add automatic protection to your application binary, preventing reverse engineering or unauthorized use.

>You can also encrypt, protect, and license data files using the Data File Protection.

Refer to Sentinel LDK Software Protection and Licensing Guide for details about the protection strategies.

Step 8: Deploy

Ensure your deployment package includes all necessary drivers, libraries, and keys. Provide end users with clear installation and activation instructions.

REST API Web Services

Alternatively, you can use the Sentinel Licensing REST API to integrate licensing functionalities, such as license and entitlement management, into your cloud-based applications (SaaS offerings) or local applications running in a trusted environment. This approach eliminates the need to embed or install the Sentinel LDK Run-time Environment or License Manager.

>Use Sentinel Toolbox to automatically generate code in your preferred programming language (C, C#, C++, Java, VB.NET) and test it in real time.

>Refer to the sample applications included in the SDK for practical implementation examples.

By following these steps, you’ll quickly establish a functional integration of the Sentinel Licensing API in your application.