License System

Introduction

Celartem License System is a software license management system which is built into this library. This system limits several faetures of SDKs from abuses. For example, both of PixelLive and Secure DjVu has their own DRM (Digital Rights Management) system and its very important to verify every viewer correctly implements the DRM limitations (such as viewing, printing and exporting) thus we want to license the features only to the applications which are verified to confirm the DRM limitations.
The other reason is to protect against abuse of our software. We greatly appreciate your understanding of our SDK licensing policy.

License namespace

The first thing to know is every thing related to license system is in License namespace. So anyway what you have to do first is to do "using namespace" this namespace or you have to add prefix License:: on every call.

License System

LicenseManager is the main interface to access the license system. As you already know, every sample contains the line of LicenseManager::setLicenseScript. You have to do this before calls to the functions.

LicenseManager& lm = LicenseManager::getLicenseManager();
lm.setLicenseScript(".....");

A license script identifies the product and its usage of SDK features. Specifically, a license script defines Product ID, Product Description and Feature Activation Schemata.

Product ID

Product ID is a 128-bit identifier which uniquely identifies a product.

Product Description

Product Description is human-readable string which briefly describes the product.

Feature Activation Schemata

Feature Activation Schemata defines the usage of features. A feature is a function provided by the SDK and Feature enumeration is used to describe them.

Each feature can be activated by one of the following schemata:

Default License Script

By default, the library is initialized with a license script which enables development license for all features. So every feature can be used in 2 weeks after build. This license script is only for the development purpose and you must obtain a license script for your product when you release the product.

Cartridge System

Cartridge system manages all the cartridges installed on a machine and it uses a centerized database. The database is initialized when some of the application firstly access to it and no formal installation, configuration and initialization is needed.

CartridgeManager

CartridgeManager is only the interface to access the cartridge system and you can get the global only one instance by calling CartridgeManager::getCartridgeManager method.
CartridgeManager& cm = CartridgeManager::getCartridgeManager();

Note for initialization on certain UNIX platforms

On certain UNIX systems, because of some security system such as SELinux, the user sometimes need to specify a world-writable path for the database by calling CartridgeManager::setLicenseDbDirectory

Activated Products

Cartridge system manages all the products installed and activated on a machine. You can get the product IDs of these products by calling CartridgeManager::getActivatedProducts method. The method returns an array of product IDs.

CartridgeManager& cm = CartridgeManager::getCartridgeManager();

SimpleArray<String> prodIds;
cm.getActivatedProducts(prodIds);

size_t count = prodIds.getSize();
for(size_t i = 0; i < count; i++)
{
    printf("%u, %s\n", i, prodIds[i].c_str());
}

Product Status

If you have a product ID, you can easily get the product status including how many cartridges currently installed on the machine. ProductStatus structure is used to describe the status and the status is obtained by CartridgeManager::getProductStatus method.

String productId = "....";
CartridgeManager& cm = CartridgeManager::getCartridgeManager();
ProductStatus ps;
cm.getProductStatus(ps, productId);

Feature Status

ProductStatus structure contains an array of FeatureInfo structure. A FeatureInfo entry describes activation scheme, remaining normal/trial cartridges and expiry for the trial cartridge.

Cartridges

A feature cartridge is consumed when the user uses the feature and the remaining cartridges actually means how many times the user can use the feature. count member of FeatureInfo structure is the number of the cartridge. There is also a special cartridge status; unlimited. If count is equal to FeatureInfo::Unlimited, the cartridge is never consumed but it allows the user to use the feature unlimitedly.

Trial Cartridges

Trial cartridges are the cartridges with expiry. The cartridges cannot be used after the expiry date-time. altCount member of FeatureInfo structure is the number of trial cartridges installed for a feature and the expiry member is the expiry. The trial cartridge also have the unlimited status and if altCount is equal to FeatureInfo::Unlimited, the trial cartridge is never consumed but it allows the user to use the feature unlimitedly until the expiry.

This document is made with doxygen 1.5.9 at Thu Jan 7 21:53:20 2010.
Caminova Logo