Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Getting Started with Sentinel Hardware Keys:Step 1: How to go about the whole process of using SHK.
Step 2: Understanding Sentinel Keys SDK components
Step 3:- Protect your application using Shelling.
Step 4:- API Protection: The method in which you insert the Business Layer
API functions into your application's source code.
Step 5:- Building the samples that came with the toolkit.
Step 6:- Using API explorer
Step 2:Sentinel Hardware Keys SDK basic Components: - We will be discussing few
components to know about each please go through Sentinel Keys Developer guide
Sentinel Keys Toolkit: - The Toolkit is a Java application. It is used for preparing
the application protection strategy and programming hardware keys for your
customers and distributors.
Generic
Component
(For all)
Sentinel
System Driver
For Customer
For Developers
Sentinel Keys
Sentinel Keys
Server
Sentinel Keys
Toolkit
Command-Line
Shell Utility
Developer Key
Sentinel Keys
License Monitor
Sentinel
Protection Installer
Secure Update
Utility
Secure Update
Wizard
(for Windows only)
Compiler
Interfaces
For Distributors
Sentinel Keys
License Manager
(stand-alone
application)
Distributor Key
Key Programming
APIs
Secure Update
Utility
and Sentinel hardware User keys attached to the system. You can select the
hardware key using the left and right arrow buttons
Sentinel User Keys:The Sentinel Keys are meant for your customers. They will be able to run your
protected application only if the correct Sentinel Key is accessed. It is available for
both stand-alone and network environments. A network key allows multiple network
clients to run the protected application concurrently. It is typically connected to a
networked system running the Sentinel Keys Server in the subnet. A stand-alone
protected application is licensed to run on a single computer without using a
network.
Sentinel Keys Server:The Sentinel Keys Server manages the licenses available with the Sentinel
Keys attached to a system. It maintains a database of the Sentinel Keys attached to
a networked system and handles the availability, maintenance, sharing, and
cancellation of licenses for its clients. It must be redistributed with your network
applications.
The Sentinel Key Server runs as Windows service with its executable under
C:\Program Files\Common Files\SafeNet Sentinel\Sentinel Keys
Server\sntlkeyssrvr.exe. The key server executable is named
sntlkeyssrvr.exe.
icons.
Step B: - Select protect my application with licensing limit I choose from below.
Select the Execution Count check box and specify 1.
Step C: - Click Prepare Key. When done successfully, the Application settings options
are enabled.
Step E: - Click the Make Shell button. When done successfully, a message box
appears. Click Close. The Make Key button is activated.
Step F: - Click Make Key. When done successfully, a message box appears. Click
Close.
Consider using the Shell option in the License Designer screen to make use of
advanced options. The Shell features can be added only using the Windows version
of the Toolkit, using any of the following options.
i) Using the License Designer Wizard - This option allows you to create a license
template by adding a Shell or API feature to it
ii) Under the Shell tab of the License Designer screen - This option allows you to add
a Shell feature to an existing license template
Using License Designer Wizard for Windows
You can launch the wizard using any of the following ways:
Click the
Using this option, you can create a new license template by adding Shell and API
features into it. This option is recommended for new users who want to be guided
step-by-step on creating a template
I want to copy a sample template
Using this option, you can create a new template by copying a sample template.
Afterward, you can modify its settings and/or build it.
I want to add features under the Shell/API tabs
This option is recommended for users who want to create a blank template here
and add features in the License Designer screen.
Option 1 - I'm new to creating features and templates
Select I'm new to creating features and templates in the License Designer Wizard
launching screen.
1.
Click Start.
2. Choose any of the two options depending on whether you wish to create a
Shell or an API feature.
3.
Click Continue.
You must add at least one file with a .exe or dll extension to proceed
Specify
Destination
Path
Type or
browse for the
path of the
destination
directory in
the edit box
under the
Change the
destination
path check
box. This is
the destination
path for
writing the
output files
(recommended
step).
Attributes
Active: Select to provide a perpetual license for using the application.
Lease: Select to allow specifying an expiration date or expiration time for the
application.
Limit executions: Select to allow specifying the number of times the protected
application will run.
Add instances later
It will allow you to add new feature instances later in the License Manager screen.
Networking and Security Settings
Network Settings
Choose from the following networking settings:
Access Mode
Stand-alone, by default.
Stand-alone mode (SP_STANDALONE_MODE)
The application looks for a license on the same system without requiring the
Sentinel Keys Server.
Network (SP_SERVER_MODE)
The application obtains a license from a network key.
Click Finish. The template you created just now is listed under the template
layout. You may add more Shell features into it, if required.
After selecting your choices in the Add Shell Feature dialog box, you must now
perform the following final steps:
The Make Shell Button
Click the Make Shell button. This will wrap the Shell layer around your executables
and DLLs and encrypt the data files; if any. This may take time depending
upon the number of files and layers you have added.
3) String:-A data feature that can contain up to 256 ASCII printable characters.
4) Raw Data: - A data feature that can contain 256-bytes of any developer-defined
data type, including printable/non-printable characters and hexadecimal numbers.
5) Integers: - Data feature that can contain any of the following integers: 8-bit, 16
bit or 32 bit.
6) Boolean: - A data feature that can contain a true or false value.
7) Counter:- A data feature that can contain a count-down value between 0 to
4,294,967,295
Please refer to API help located in C:\Program Files\SafeNet Sentinel\Sentinel
Keys\1.2.1\Compiler Interfaces\Help\English\API\Business_Layer_API_Help.htm
directory for more details about each feature.
The API features can be added using any of the following ways:
1) Under the API tab of the License Designer screen - This option allows you to add
an API feature to an existing license template.
2) Using the License Designer Wizard - This option allows you to create a license
template by adding a Shell or API feature .We will start from the add feature this
time since we have covered creating template earlier.
Below is an example of adding string feature.
To obtain the Add Feature dialog box:
1. In the License Designer screen, load the template to which the API
feature will be added.
2. Click the API tab.
3. Click the Add button. The Add Features dialog box appears.
4. Select String.
5. Specify a string containing up to 255 ASCII printable characters for the default
instance Specify a write password if you want to write the feature value. The option
will be disabled if you have selected the Read-only option.
6. Selecting the Add instances later check box will allow you to add new feature
instances later in the License Manager screen.
7. If you selected the check box described in step 6, specify the maximum size. It
has to be greater than the existing string length and less than 256 ASCII printable
characters.
8. Provide a name for this feature (necessary).
9. The constant name will be automatically generated. However, you may modify it,
if needed.
10. You may optionally provide comments. When done, click OK.
2.
Specify the File generation option to guide on how often the template header
file and code sketch should be generated. You can select any of the following
options:
o
3. Select the Operating system for which header files are to be generated. The
available options are Windows, Linux, and Macintosh.
Note: The toolkit will not be available on non-windows platforms. The header files for
Linux and Macintosh should be generated from the Windows Toolkit and moved to
the intended platform.
4. Select the programming language of your choice. If the language/compiler you
want is not shown, select Common header. It will generate a language/compilerindependent header file. You need to convert the syntax into your chosen
development language on your own. You can also select the Generate For All option
to generate header files for all supported languages.
5. You can set the following query-response settings if an AES feature is included in
your license template:
o
o
o
Number of queries
Specify the number of queries you want to make.
Query size
Select how long, in bytes, you want the query string to be.
Include Shell features (for Windows only)
If you have added any Shell features to your template, we recommend
you to select this check box
6. Make sure that both the Developer key and Sentinel Key are attached to the
system. The Sentinel Key must be selected in the Key Status panel.
7. Click the Build button. A dialog box will appear displaying the status of the
activity.
8. As soon as the license template is built, a dialog box will appear prompting you to
copy the libraries and header files (include files) at a path of your choice.
9. You may click Copy to copy the header file
10. To view the code sketch for this license template in the selected language, click
View on the Build Option Tab.
When a license template is built, the following tasks are performed:
i) Sentinel Key is programmed with the license information.
ii) Header file is generated.
iii) Code sketch is generated.
Add the Business Layer API functions into your applications source
code. The Business Layer API Help provides complete details on each function.
Compile your application after including the Sentinel Keys header
files and libraries. The code snippet below illustrates the most-basic API functions
used for implementing licensing.
int main ().
{
/*Calling SFNTSetContactServer( ) */
Sets the Sentinel Keys Server to be contacted for obtaining a license.
You may optionally call this function to direct the license request to a specific
Sentinel Keys Server for obtaining a license. The function needs to be called before
calling SFNTGetLicense.
/*Calling SFNTGetLicense ()*/
Obtains a license from the Sentinel Key (having required developer ID and license
ID) attached to a system.Call this function before calling any other Business Layer
API function in order to obtain a license.
/*Calling SFNTReadString()*/
Reads the String feature value in the Sentinel Key.
You can call this function anytime after successfully calling SFNTGetLicense.
/*Calling SFNTReleaseLicense()*/
Releases the license and cleans up the memory allocated to the client library
resources.
}
You could embed these APIs within your applications source code depending on
where the application should request the license. These are the basic licensing APIs.
The Business Layer API Help provides complete details on each function
Step 5:- Building the samples that came with the SDK.
Sample applications are provided that demonstrate various licensing
models, such as lease and demos. These samples make use of Business Layer
API functions, suitable for that licensing scheme.
Follow the steps given below.
1. In License Designer select load License Template Types select samples choose
a sample license template provided (e.g.:- LeaseDemo) in the Toolkit.
2) Provide your build options under the Build Options tab, such as specify the
development language you want the sample for.
3) Build it by clicking Build button. The following dialog box will appear
(the dialog box differs across platforms) on completion of the build
process for windows sample.
4) Click the Take me there link (the dialog box differs across platforms).
You are directed to the language-specific directory for the sample wherein you can
compile the sample application and understand the API functions used.
Working with the Sample (VC++):The SHK API help is located in the C:\Program Files\SafeNet Sentinel\Sentinel Keys\
1.2\Compiler Interfaces\Help\English\API\Business_Layer_API_Help.htm directory.
The SHK Visual C++ samples are located in the C:\Program Files\SafeNet
Sentinel\Sentinel Keys\1.2.1\Sentinel Keys Toolkit\Samples\Microsoft\Visual C++
sub-directories.
Final screen
The Developer ID of your Sentinel Key is shown in the Key Status Panel.
Test your template you have built .You will begin by contacting the Sentinel
Key for a license (SFNTGetLicense API call).When you open the template the
Developer ID is entered for you.
Some of the commonly used terms:RTC Tokens: - It contains a tamper resistant internal real-time clock that indicates
the exact date and time to track the usage of the leased applications. The real clock
keeps track of time independent of the system clockproviding the best solution
against time tampering attacks.
Non-RTC tokens with Sentinel V-Clock allows reliable and secure distribution
of time-limited applications. These do not require an on-board battery to detect time
tampering and allow you to tolerate the number of time tampering attempts
specified in the cheat counter.
Hard Limit: The hard limit specifies the number of tokens (instances) a license can
have or number of instances of licensed application that can be run simultaneously.
User limit:-A soft limit that restricts the number of users allowed by the hard limit.
Otherwise, the number of users allowed is equivalent to the hard limit
Cheat counter is a count-down value that allows tolerating the time tampering
attacks ranging between 1 second to 30 days (excluding the daylight savings) till it
reaches zero. For other attributes please refer to Sentinel Keys Developer's Guide.