Tutorial: Sentinel LDK Cloud Licensing (CL) with Sentinel EMS
Using Machine Accounts for Identity-Based Licensing
Looking for a powerful, centralized, role-based solution for handling all of your software protection, licensing, and entitlement needs? You've come to the right place!
•Sentinel LDK is a comprehensive, out-of-the-box software monetization solution that protects and licenses your applications and services, so that you can maximize revenues while introducing flexible and customer-centric offerings into the market.
•Sentinel EMS entitlement management system has a straightforward design that walks you through the process of defining the various features and products that match the features and products in your back office system (ERP, CRM, billing system, or sales system).
Cloud Licensing (CL) Service combines Sentinel LDK and Sentinel EMS to offer a user-centric, identity-based approach to cloud license fulfillment. Thales securely hosts the CL Service for you on its servers. The CL Service described in this tutorial consists of two primary components: Sentinel EMS, which handles license fulfillment and machine account (identity) management, and Sentinel LDK, which manages cloud licenses and machine account consumption.
The Basics
The following are the foundation of Sentinel EMS with Sentinel LDK enforcement. It's important to understand these terms before you perform the steps in this Getting Started Guide.
Sentinel EMS
Sentinel® EMS™ is a web-based solution that provides you with a centralized interface for all your license and entitlement management functions. It offers an easy-to-use interface for all your back office systems and a variety of advanced data collection and reporting functions.
Sentinel LDK Envelope
Sentinel LDK Envelope provides both copy and reverse-engineering protection for applications on various platforms. Its easy-to-use user interface enables you to apply protection to executable files and DLLs in minutes.
ToolBox and Sentinel Licensing API
Sentinel LDK ToolBox is an interactive application that enables software developers to learn about the various Sentinel LDK APIs. With this tool, you can execute API functions, observe their behavior, and copy the corresponding source code for integration into your own applications. For more information, see the Sentinel LDK ToolBox User Guide.
Sentinel Licensing API enables you to integrate finely grained license enforcement into your application for an unlimited number of features, thereby ensuring end-user compliance with licensing terms. Each feature in your application is integrated separately using a unique feature ID and login API call. For more information, see the Sentinel LDK Software Protection and Licensing Guide.
Features
Features are the basic building blocks of products and licenses. Each feature can represent anything from a functional component to an entire application.
Cloud Licensing Service
Sentinel LDK cloud licensing service (also known as CL Service) refers to software and service licensing that Thales hosts on a service-hosted, cloud license manager server.
Machine Accounts
A machine account represents a set of cloud licensing permissions that grant authorization rights to a customer's end user to access protected applications or services on one or more client devices (also known as registered machines). Machine accounts are an integral part of cloud licensing.
TIP Want to learn more about any of the concepts and terminology used in Sentinel EMS with Sentinel LDK enforcement? Check out the Glossary at the end of this guide.
Comparing Software (SL), Cloud (CL), and Hardware (HL) Licensing Methods
Sentinel LDK supports various licensing methods to suit your specific needs and requirements. Each method has its unique advantages for developers and end users. This tutorial focuses on cloud licensing (CL) for its flexibility and ease of use.
Tutorial Workflow
This tutorial showcases how to use Sentinel LDK and Sentinel EMS to protect and license an application. You will use a sample TextEditor application that has two separately licensable features: Edit & Save and Print. To simplify this tutorial, TextEditor is already integrated with the necessary Sentinel LDK Licensing API calls to manage and consume licenses for each feature.
Learn about the different personae in the Sentinel EMS and Sentinel LDK workflows
Initial Setup, License Integration, Application Protection, and Testing
This end-to-end workflow illustrates the license integration and application protection process for developers and product owners, focusing on testing and integration.
Production and License Fulfillment for a Vendor's Customers
This end-to-end workflow for Sentinel EMS personae occurs after testing is done, focusing on actual production and license fulfillment for a vendor’s customers.
See what's not included in this workflow
Before You Begin
•Install the latest version of Sentinel LDK. For instructions, see Sentinel LDK Installation Guide with Sentinel EMS.
•Review The Basics to learn about the Sentinel LDK and Sentinel EMS components.
•Make sure that your Thales account enables you to access Sentinel EMS. At minimum, you need a role in Sentinel EMS that includes Customer Management permissions. Contact your Thales representative for assistance if needed.
One-Time Setup
Make sure that you are logged on to the Sentinel EMS vendor portal. Show me how
In this step, you review the global cloud licensing permissions, which are the default usage permissions for all customers that use CL keys. These settings are also inherited by each customer's end user machine accounts. Later, you can override these settings for specific customers and end user machine accounts as required.
This step provides explanations of each of the settings, so that if you need to modify these settings later, you will understand how to define each option. Unless you already know your specific needs, you can retain the default settings for now. To learn more about any of these settings, see Cloud Licensing Permissions.
1.From the navigation pane, select Configuration > Cloud Licensing Permissions.
2.Look at each of the settings.
•You can set the Maximum Number of Machine Accounts per Customer to unlimited or to the number of network seats available on your Sentinel LDK Master license.
•You can set the Maximum Number of Registered Machines per Account from 1-10 or unlimited. You can leave the default value for now.
•You can set the Waiting Period for Reusing Deleted or Disabled Registered Machines (Days) value to an integer of 1-30 representing 1-30 days, or you can select the Allow Immediate Reuse check box to override the waiting period. and allow deleted or disabled machines to be automatically re-registered immediately.
•When you set Allow Online Connection to Licenses to Yes, any machine with an installed identity string can consume a license from the service-hosted, cloud license manager server. If you set this option to No, then end users cannot consume the license to access the protected application.
•When you set Allow License Detaching to Yes, any machine with an identity string can detach a license (a network seat) for a protected application from the service-hosted, cloud license manager server for offline use whenever a license is required.
•If Allow License Detaching is set to Yes, then you can enable concurrency for manually detached licenses using the Allow Concurrency for Detached Licenses option.
OPTIONAL At this point, you might want to customize the license notification email template. This is a one-time step that enables you to modify the out-of-the-box email template that is sent automatically to a customer's end user when a machine account is created, which is described towards the end of this training. For detailed instructions on modifying the email template, see Sentinel LDK Account Certificate.
Create a Catalog
In this section, you create a catalog that includes your saleable items—a feature and a product. Make sure that you are logged on to the Sentinel EMS vendor portal. Show me how
The first step in creating a catalog is defining features.
3.In the Add Feature page, if the Namespace list is displayed, select the namespace you want to use. If you have your organization's batch code (known as a namespace in Sentinel EMS), you may want to select that namespace. Otherwise, select DEMOMA to use the demo namespace and batch code.
4.In the Add Feature page, in the Name field, enter, Edit & Save.
5.In the Identifier field,
When you create your own features, you can use the default identifier or apply another identifier to match an existing feature in one of your company's products.
The identifier must match the feature ID in the Sentinel LDK application you are using to protect your application (Sentinel LDK Envelope or Sentinel Licensing API) as described in Features.
NOTE If Sentinel EMS supports additional enforcements, you may see additional fields. These fields are not relevant for Sentinel LDK and can safely be ignored.
6.Click Save.
7.Now add another feature. In the Features page, click Add Feature .
8.In the Add Feature page, if the Namespace list is displayed, select the namespace you want to use. If you have your organization's batch code, you may want to select that namespace. Otherwise, select DEMOMA to use the demo namespace and batch code.
9.In the Add Feature page, in the Name field, enter, Print.
10.In the ID field, enter 502.
NOTE This sample already embeds Sentinel LDK Licensing API calls for feature IDs 501 and 502. When working with your own applications, you would share the feature identifiers with your developers. The developers would then include these as feature IDs in Sentinel LDK Licensing API login calls from the relevant sections in the application code. This enables the application to determine if the customer has access to a valid license for each feature.
You've created your first features. Next, you will add these features to a product.
Now that you created your features, you can add them to a product. This is known as associating features with a product.
3. If Sentinel EMS includes support for other enforcements in addition to Sentinel LDK, you need to select the relevant enforcement before continuing.
In the Add Product page, in the Enforcement Type field (not shown), select Sentinel LDK. Otherwise, skip to the next step.
4.In the Add Product page, if the Namespace list is displayed, select the namespace you used when creating a feature. Otherwise, skip to the next step.
5.In the Add Product page, in the Name field, enter TextEditor.
6.In the Identifier field, leave the default value.
Later, when working with your own products, you can change the number to match an existing product identifier in your saleable product.
7.Expand Additional Attributes, click the Locking Type arrow
8.In the Available Features area of the Associate Features pane, click the features you created one by one and add them to the Associated Features pane.
NOTE In the Associated Features pane, a value for Default License Model may or may not be displayed depending on your Sentinel EMS configuration.
9. Let's configure the license models for each feature.
In the Associated Features pane, either select the check box for the Edit & Save feature and click the Configure License Model button, or, under Actions, click Configure License Model.
10. Set the license model for the Edit & Save feature.
a. Click the Name arrow and select Time from License Generation, which is one of the available license models. Notice that the displayed attributes change to reflect the selected license model.
b. Under License Terms, in the Number of Days box, enter 365.
c. Under Concurrency, set Enable Concurrency to Yes. This is required for using Produce and Push to activate an entitlement.
d. In the Concurrent Instances box, enter the number of license instances that need to be able to run at the same time, for example, 2.
e. Click Save.The license configuration for the Edit & Save feature is saved.
11.In the Associated Features pane (not shown), follow the steps described earlier to open the Configure License Model dialog box for the Print feature. Make sure to clear the check box for Edit & Save if you selected it earlier.
a. Click the Name arrow and select Execution Count, which is one of the available license models. Notice that the displayed attributes change to reflect the selected license model.
b. Under License Terms, in the Executions box, enter 5.
c. Under Concurrency, set Enable Concurrency to Yes. As mentioned earlier, this is required for using Produce and Push to activate an entitlement.
d. In the Concurrent Instances box, enter the number of license instances that need to be able to run at the same time, for example, 2. You must set a minimum of 1 to use Produce and Push to activate an entitlement.
e. Click Save.The license configuration for the Print feature is saved.
12. In the Add Product page (not shown), click Save. The product is created as a draft.
Define a Customer and Administrator User
In this section, you define a customer for the entitlement that you will be creating later. At this stage, you will also create an administrator user for the customer. Adding an administrator user lets you delegate machine account management directly to the customer. Without an administrator user, you, the vendor, would have the sole responsibility of managing your customers' end-user machine accounts. Make sure that you are logged on to the Sentinel EMS vendor portal. Show me how
When working with cloud licensing, every entitlement is associated with a customer. We are going to create a customer now, but you can create customers whenever needed at any stage of the process prior to generating a license. Make sure that you are logged in to the Sentinel EMS vendor portal.
1.From the navigation pane, select Customers > Customers.
2.In the Customers page, click Add Customer .
3.In the Add Customer page, if the Market Group list is displayed, select the market group for the namespace that you are using, for example, DEMOMA.
4.In the Add Customer page, in the Name field, enter a name for the customer that you are creating, for example Papyrus & Words. You can enter any customer name that you want.
5.Leave the Identifier blank, so that a customer identifier will be generated automatically when you save the customer.
6.In the Associated Users area, if an administrator user already exists, you can select that user to link to this customer. All types of users are listed here—not just administrator users. You can search by various fields to find the user that you need.
In our case, though, we have not yet created an administrator user. Let's do that now after we save the customer.
7.Click Save.
You've created your customer. Next, you will assign an administrator user to this customer.
Before we continue, let's create an administrator user who will manage machine accounts for our customer. The administrator user is typically a procurement, contract, or purchasing manager who handles licenses within an organization.
This will save us time when creating an entitlement because the administrator user is automatically assigned to the entitlement when you select the customer. (If several users are associated a customer, you may need to specify the relevant administrator user.)
The administrator user will also automatically receive email notification informing them that the licensed products are ready to share with consumer end users as soon as the entitlement is activated. Administrator users can view and manage only the machine accounts for which they are responsible. For the purposes of this training, you will assign yourself as the administrator user.
3.In the Add User page, if the Market Group list is displayed, select the market group for the namespace that you are using, for example, DEMOMA.
4.In the Add User page, in the User ID field, enter an identifier for the user that you are creating, such as 123456. You can enter any identifier that you want, including a name or email address.
5.In the Email field, enter your email address, so that you will receive a notification when the entitlement is activated. The image shows an example.
6.In the Password field, enter a password that you will remember. Click the icon to see the criteria.
You can use this password to log on to the Sentinel EMS customer portal to manage registered machines for the machine accounts that you handle.
7.In the Name field, enter a name for the administrator user, such as Robin Early. You can enter your own name if you want.
8.Under User Type, select Administrator. Only administrator users can manage machine accounts for cloud licensing.
9.In the Customer field, start typing the name of the customer that you created earlier. As you type, a list of suggestions is displayed. Select the relevant entry. This associates the user with the specified customer when you save the customer.
10.Click Save.
You've created your user. In the Users page (not shown), you can expand the user that you just created to view the various user attributes.
Next, you will create entitlement and generate licenses.
Generate a License and Push It to the Cloud
In this section, you generate a license and push that license to Thales' cloud license server manager using Sentinel EMS with Sentinel LDK enforcement.
First you will generate an entitlement to fulfill an order for a specific customer. Then you will use Produce and Push to generate a cloud license for the product features included in the entitlement. The license will automatically be pushed to Thales's service-hosted, cloud license manager server, making it ready to share with the customer's end users. Make sure that you are logged on to the Sentinel EMS vendor portal. Show me how
In this step, you are creating an entitlement.
1.From the navigation pane, select Entitlements.
2.In the Entitlements page, click Add Entitlement .
3.In the Add Entitlement page, under Assign Customer / Channel Partner, set the required fields:
a. If the Market Group list is displayed, select the market group that you are using, for example, DEMOMA.
b. In the Customer field, start typing the name of the customer that you created earlier. As you type, a list of suggestions is displayed. Select the relevant entry. You must specify a customer to use Produce and Push to activate an entitlement.
c. In the User Email field, verify that the email address of the administrator user that is associated with the customer is displayed. Earlier, you defined yourself as the administrator user, so this should be your email address. Specifying the relevant email address enables your organization to delegate license management to the customer via the Sentinel EMS customer portal.
4.Expand Define Entitlement Attributes > Additional Attributes and optionally set one or more of the following.
a. (Optional) Set Allow Activation to Yes and ensure that Vendor Only is selected. This ensures that end users that access the Sentinel EMS customer portal cannot activate the products in the entitlement.
b. (Optional) Set Entitlement as a Whole to Yes. This recommended setting enables you to activate all products at once without the need for selecting each product.
c. (Optional) Set Send Notification to Yes. This sends an email to the administrator user, notifying them that the entitlement is ready for activation.
5.In the Associate Products / Product Suites pane, under Available Products, click the product you created to add it to the Associated Products / Product Suites section.
6.Click Save to save the entitlement as a draft. (If you skip this and go to another tab, your input will be lost.)
7.In the Entitlements page, in the Actions column, click to complete the entitlement.
(The image shows the Draft status prior to confirmation.)
8.In the confirmation box, click Complete (not shown). The entitlement details are saved. An Entitlement Certificate email is sent to the user email address you entered earlier.
(The image shows the Completed status post-confirmation.)
In the next step, you will
In this step, you generate a cloud license and push the license to the Thales service-hosted, cloud license manager server in a single step.
1.From the navigation pane, select Entitlements.
2.Expand the entitlement you created and click Produce & Push.
3. In the Activate Products page, verify that the Activatee Email is correct.
4.Click Produce & Push to generate a new key with the required licenses.
TIP If you ever need to update this key, the Generate Licenses area lets you choose between generating a new key or updating the licenses on the existing key.
Unless needed, Thales recommends that you update the existing key. By maintaining a single key for each customer, you limit confusion and ease maintenance over time.
5.The Activate Products page displays information about the products you are activating.
6.Click Done. A license certificate is sent to the activatee email address that you specified earlier.
The license certificate email does not include a license string because the end user machine accesses the cloud license using unique identity credentials instead of a license string.
7.The key is marked as Activated, and the license is now stored on Thales' service-hosted, cloud license manager server.
8.(Optional) View the key in the Sentinel Keys page.
In the navigation pane, click Sentinel Keys. The Status column indicates the status of the Sentinel key.
The Enabled status means that the license was pushed successfully to the cloud license manager server. You can expand the key line item and switch between the tabs to view the associated products and features, associated memory, and key attributes.
TIP When there are multiple keys on the page, you may want to search by customer to locate the key.
Congratulations! You successfully generated a CL (cloud licensing) key.
Manage End User Machine Accounts
Earlier, you created an administrator user, who is responsible for handling machine account management for your customer. You are now using that persona to create a machine account for your customer's end user. You will enable the Send Notification option to send an email directly to the end user, informing them that they can start using the TextEditor application by clicking the link in the email. Clicking this link installs identity credentials on the end user's machine using an identity string. This string is used to authorize the use of the application on that machine.
Where do you create an end user machine account?
Vendors create machine accounts from the Sentinel EMS vendor portal. Customers' administrator users create machine accounts from the Sentinel EMS customer portal.
For the purposes of this training, you can use either portal to create an machine account.
1.Navigate to the Sentinel EMS vendor portal URL shared by Thales.
2.Log on using the user name and password provided by Thales.
3.From the navigation pane, select Customers > Machine Accounts.
4.In the Machine Accounts page, click Add Machine Account .
5.In the Add Machine Account page, in the Customer field, start typing the name of the customer that you created earlier. As you type, a list of suggestions is displayed. Select the relevant entry. This associates the machine account with the specified customer when you save the machine account.
Notice that the permission settings on the right side of the page are now editable.
6.In the Name field, enter a name for the end user who will actually be using your application. For now, you can enter your own name if you want.
The name you enter will be used in the salutation of the notification email. This email contains identity credentials that enable the end user to access the protected application. You'll learn more about that in the next section.
7.In the Email field, enter your email address, so that you will receive a notification when the machine account is created. In a real-life situation, you would enter the email address of the actual end user.
8.Ensure that Send Notification is set to Yes. This will send an email to the machine account email address you specified above when the machine account is created. The email will contain an identity link that an end user must click to install an identity string on their machine, which will enable them to use the protected application provided by the customer.
If you set this to No, you will have to provide the end user with the identity link included in the email in another way.
9.In the Permissions area, leave the settings as is. A machine account inherits the permissions defined for the customer, which inherited the permissions you defined earlier in the global settings. This may sound complicated, but it's really just a hierarchical inheritance structure—global permissions are passed to the customer, and the customer permissions are passed to the machine account. You can modify these permissions at any level as needed.
You can leave the Expiration Date as Never Expires, or you can set an expiration date if you want.
10.Click Save. You've created your first machine account.
11.In the Machine Accounts page, notice that in addition to the attributes that you just defined, an Identity Code was added by the system to identify the individual machine account when accessing the application.
12.Check your email to see the message that will be sent to actual end users.
1.To connect to the Sentinel EMS customer portal, navigate to the URL shared by Thales using the following modified format: https://YOUR-SENTINEL-EMS-DOMAIN/customer/login
Log in using the Email option and the credentials that you created for the administrator user in Define a Customer and Administrator User.
2.From the navigation pane, select Machine Accounts.
3.In the Machine Accounts page, click Add Machine Account .
4.In the Add Machine Account page, in the Name field, enter a name for the end user who will actually be using your application. For now, you can enter your own name if you want.
The name you enter will be used in the salutation of the notification email. This email contains identity credentials that enable the end user to access the protected application. You'll learn more about that in the next section.
5.In the Email field, enter your email address, so that you will receive a notification when the machine account is created. In a real-life situation, you would enter the email address of the actual end user.
6.Ensure that Send Notification is set to Yes. This will send an email to the machine account email address you specified above when the machine account is created. The email will contain an identity link that an end user must click to install an identity string on their machine. The identity string enables them to use the protected application provided by the customer.
If you set this to No, you will have to provide the end user with the identity link included in the email in another way.
7.In the Permissions area, notice that many of the options are read-only. These permissions are inherited from the associated customer's permissions and cannot be changed in the Sentinel EMS customer portal (although they can be changed in the Sentinel EMS vendor portal if needed).
Leave Allow Access to All Associated Products as is to enable the end user to access and run your application. You can leave the Expiration Date as Never Expires, or you can set an expiration date if you want.
8.Click Save. You've created your first machine account. Check your email to see the message that will be sent to actual end users.
Install Identity Credentials
Now that you have created a machine account, the customer's end user can install their unique identity credentials.
This step emulates what end users do to start using an application on their device.
You should have received the email with your identity credentials.
1.Open the email that you received from Sentinel EMS. (If you didn't receive the email, please check your Spam folder.)
Notice that the Name attribute value that you provided in the machine account is used in the salutation.
2.Click one of the links depending on where the application is installed or will be used. To install the identity string on a machine, you must click the installation link on the actual machine where the vendor's application runs.
When the vendor's application runs for the first time, the machine is automatically registered on the service-hosted, cloud license manager server (unless the Maximum Number of Registered Machines per Account cloud-licensing permission is set to Unlimited).
3.You, as the vendor user or administrator user, can now view and manage the registered machine in Sentinel EMS vendor or customer portal, respectively.
In Sentinel EMS, navigate to Customers > Machine Accounts, and expand the machine account that you created to view the registered machine. Here is an example of what the registered machines section might look like on the Machine Accounts page. The content is identical in both portals. Notice the Actions column, where you can disable, enable, delete, or synchronize the machine.
Integrate Licensing and Protection
This section is intended only for developers. It's time to protect the TextEditor application by using Sentinel LDK Envelope. Sentinel LDK Envelope utilizes the Sentinel LDK Licensing API to establish a strong binding between the protected software and the license installed in the protection key.
Now you created a machine account and installed the identity credentials, you (the developer) can use Sentinel LDK Licensing API to implement and test the licensing integration of the required features. You can license each of these features using Sentinel EMS. This provides granular control over the functionality available to users based on their licenses.
TextEditor is already integrated with the necessary Sentinel LDK Licensing API calls to manage (or consume) licenses for the Edit & Save and Print features for this tutorial. You do not need to perform additional integration steps to enable licensing functionality in this tutorial.
You can review TextEditor’s source code and comments to see how the Edit & Save and Print features are integrated with the Sentinel LDK Licensing API.
1. Navigate to the %ProgramFiles(x86)%\Thales\Sentinel LDK\Samples\Licensing\csharp\TextEditor folder to access the source code.
2.Open EditorForm.cs, for example, to view the source code, as shown in the snippet.
Notice the constants that define the feature IDs for Edit & Save and Print.
When the TextEditor application loads, Sentinel Licensing API validates the licenses for each feature. This best practice ensures that end users can see which features are available for use as soon as they log in to the application. Otherwise, a feature might appear disabled or return an error when a user tries to use it.
In this sample, Sentinel Licensing API logs in to the Edit & Save feature immediately, enabling users to start consuming the license as soon as they open TextEditor.
Sentinel Licensing API logs in to the Print feature to consume a license only when a user actually tries to print (not shown). Validating the license when the application loads and logging in to the feature only when needed prevents unnecessary license consumption, which is especially useful for execution count-based licenses.
...
namespace TextEditor
{
public partial class EditorForm : Form
{
private String filePath = String.Empty;
private static string defaultScope = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?> " +
"<haspscope/> ";
// Set the constants for the licensed features
// Sentinel Licensing API uses these constants to determine whether a valid license exists for each feature ID
// In Sentinel EMS, these same feature IDs must be used to define the features in the catalog
const int LDK_FEATURE_Edit = 501;
const int LDK_FEATURE_Print = 502;
public EditorForm()
{
InitializeComponent();
}
...
private void printToolStripMenuItem_Click(object sender, EventArgs e)
{
// Log in to the licensed Print feature
HaspFeature feature = new HaspFeature(LDK_FEATURE_Print);
Hasp hasp = new Hasp(feature);
HaspStatus status = hasp.Login(VendorCode.Code, defaultScope);
if (HaspStatus.StatusOk == status)
{
PrintTxt(this.textBox.Text);
}
else
{
MessageBox.Show("Print license not found.",
"TextEditor",
MessageBoxButtons.OK,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2);
}
}
...
private void EditorForm_Load(object sender, EventArgs e)
{
// Sentinel Licensing API determines if a valid license exists for the Edit & Save feature
// and logs in to consume the license
HaspFeature feature = new HaspFeature(LDK_FEATURE_Edit);
Hasp hasp = new Hasp(feature);
HaspStatus status = hasp.Login(VendorCode.Code, defaultScope);
if (HaspStatus.StatusOk != status)
{
this.newToolStripMenuItem.Enabled = false;
this.saveToolStripMenuItem.Enabled = false;
this.saveAsToolStripMenuItem.Enabled = false;
this.textBox.ReadOnly = true;
this.Text = this.Text + " - " + "Viewer Mode";
}
// Sentinel Licensing API determines if a valid license exists for the Print feature
String scope =
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?> " +
"<haspscope>" +
" <feature id=\"" +
LDK_FEATURE_Print +
"\"/>" +
"</haspscope>";
String format =
"<haspformat root=\"hasp_info\">" +
" <feature>" +
" <attribute name=\"id\" />" +
" <attribute name=\"locked\" />" +
" <attribute name=\"expired\" />" +
" <attribute name=\"disabled\" />" +
" <attribute name=\"usable\" />" +
" </feature>" +
"</haspformat>";
String info = null;
status = Hasp.GetInfo(scope, format, VendorCode.Code, ref info);
if (HaspStatus.StatusOk != status)
{
this.printToolStripMenuItem.Enabled = false;
}
}
}
}
In this section, you are using Sentinel Envelope to protect the TextEditor application.
1.From the Start menu, select Sentinel LDK. The Sentinel LDK Launcher opens.
2.Click Envelope to launch Sentinel LDK Envelope. Sentinel LDK Envelope opens to enable you to protect your application or service.
3. In the Sentinel Envelope Project pane, select Sentinel Vendor Code.
4.Select Use Vendor Code from file.
5.If not displayed by default, navigate to %ProgramFiles(x86)%\Thales\Sentinel LDK\VendorCodes\, and select DEMOMA.hvc
6.In the Sentinel Envelope Project pane, select Programs.
7.On the right side of the Programs pane, click Add Programs.
8.In the Add Programs window (not shown), navigate to the %ProgramFiles(x86)%\Thales\Sentinel LDK\Samples\Tutorial\TextEditor folder.
9.Select TextEditor.exe and click Open. TextEditor.exe is added to the Program list.
10.In the Sentinel Envelope Project pane, under Programs, select TextEditor.exe.
11.At the bottom-right of the Protection Details pane, click Protect. The Protection Status dialog box (not shown) shows the progress and displays a message when the protection is complete.
12.Click Close to close the dialog box when the protection process is complete.
13.Close Sentinel LDK Envelope. You are prompted to save the changes to the current project.
14.Click Save. The Save As dialog box is displayed. In the File Name field, enter Tutorial_TextEditor (or any name of your choice) and click Save.
Now that you have licensed the features and protected the application, it's time to test and validate the licensing and protection. Continue with End User Starts Using the Application / Test Your Application.
End User Starts Using the Application / Test Your Application
Now that the application is ready to use and you have installed the unique identity credentials, the customer's end user can launch your protected application or service.
For the purposes of this training, let's assume that:
• Your application is already packaged together with Sentinel Run-time Environment.
•The end user has already installed the application on the target device and is just waiting for the license to use the application.
•You, the developer, want to verify that the application is protected and that the licenses are working correctly.
This step demonstrates how to launch and test the TextEditor application. You can also see how its licenses are used.
1.Before you begin testing, copy the hasp_net_windows.dll file from %ProgramFiles(x86)%\Thales\Sentinel LDK\Samples\Tutorial\TextEditor to the output folder where TextEditor.exe is located.
2.Open the Tutorial_TextEditor folder you created and double-click the protected Texteditor.exe program to launch the TextEditor application.
You can see that the TextEditor application is protected in the following ways:
•The size of a protected application is larger than an unprotected application.
•The application load time of a protected application is slightly longer.
•When you use DEMOMA, a message box opens letting you know that the program is protected with a demo Sentinel protection key.
3.Test the TextEditor application to ensure that the licenses work correctly.
TextEditor should run in editor mode enabling you to add and edit text and to open a text file. Try saving and printing the document.
If TextEditor opens in viewer mode, the text area appears disabled, and you can open a document, but you cannot edit or print it. Verify that the licenses and feature IDs are configured correctly for the Edit & Save and Print features in Sentinel EMS and Sentinel Licensing API.
4.(Optional) You can log in to Sentinel Admin Control Center (ACC) to view and manage how licenses for Edit & Save and Print are consumed. Enter http://localhost:1947 in the address field of the web browser to open Sentinel Admin Control Center on your local machine.
Ensure that the Sentinel LDK License Manager service is active on the machine where Admin Control Center runs.
5.From the navigation pane, go to the Features page. For detailed information, see the Sentinel Admin Control Center User Guide.
6.In the Restrictions column. You can see that:
a. For Edit & Save, the time period is set as 365 days (as configured in Sentinel EMS) with the start and end dates and times.
b.For Print, five executions are available.
Congratulations! You licensed and protected the TextEditor application.
Glossary
Let's review the concepts and terminology that you need to know to work with Sentinel LDK enforcement in Sentinel EMS.
Show the Glossary