02.04.2013 Views

Sentinel Hardware Keys Developer's Guide - Customer Connection ...

Sentinel Hardware Keys Developer's Guide - Customer Connection ...

Sentinel Hardware Keys Developer's Guide - Customer Connection ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7 – Implementing Secure Licensing<br />

Contents Glossary Index Troubleshooting<br />

Note: Use floating values for comparison. Instead of using only the SP_SUCCESS<br />

decimal value for comparing the API return codes, you may add floating<br />

point values (like 1.5) to it. This provides more security against reverse<br />

engineering of the assembly code.<br />

If the correct key is attached, the variable will contain the proper value. In<br />

actual practice, this technique is most effective if the mathematics behind<br />

the correct value is more complicated than simple addition.<br />

Checksum Your Code<br />

180 <strong>Sentinel</strong> <strong>Hardware</strong> <strong>Keys</strong> Developer’s <strong>Guide</strong><br />

<br />

You should adopt the practice of making a checksum of your critical data.<br />

You should also verify the validity of the application and any DLLs or shared<br />

libraries that it uses. This helps detect if the code or data has been modified<br />

and identify when your application has been tampered.<br />

Dealing With Missing <strong>Sentinel</strong> <strong>Keys</strong><br />

If no <strong>Sentinel</strong> Key is attached to the computer or in network when a protected<br />

application is run, an error is returned by the SFNTGetLicense API<br />

function. If a connection is established, but the key is later removed, subsequent<br />

API functions will return errors. Refer to the Business Layer API Help<br />

for exact status codes.<br />

If your application detects that the <strong>Sentinel</strong> Key is not present, it is up to you<br />

to decide what action you want to take. Typically, you should not shut down<br />

your application because of a single unexpected response.<br />

Instead, repeat your query; if the response is still wrong, then you can take<br />

action. Possible actions include:<br />

Display a message and wait for the user to respond. This method does<br />

not prevent users from running the application, but it makes doing so<br />

extremely annoying, especially if the application queries the<br />

hardware key frequently.<br />

Shut down the application after a predetermined number of failed<br />

queries. (However, only under the most extraordinary circumstances

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!