Zentitle2Core Library

The C++ Licensing Client implements bindings to the Zentitle2Core C++ library's methods, allowing applications to leverage the functionality of the low-level C++ Core library using high-level C++ code.

Zentitle2Core Library Integration

The Zentitle2Core library is distributed as part of the Licensing Client (C++) package and is not maintained as a standalone module. It is included in the same artifact package and organized into platform-specific subdirectories.

These directories contain the precompiled Zentitle2Core binaries required for runtime execution on each platform.

All versioning information, updates, and related release notes are documented within the Licensing Client (C++) release notes.

The Licensing Client (C++) – Release Notes

Dynamic Library Loader

To interact with the Zentitle2Core native binaries, the SDK uses a utility class called DynamicLibraryLoader, located in the helpers namespace.

This class provides a cross-platform abstraction over OS-specific dynamic library mechanisms (LoadLibrary on Windows, dlopen on Linux/macOS), allowing the application to:

  • Dynamically load the Zentitle2Core shared library at runtime

  • Resolve exported functions and global variables by name

  • Detect if a symbol exists before attempting to call it

  • Manage library lifetime and errors consistently across platforms

Key Features

  • Cross-platform support for Windows (.dll), Linux (.so), and macOS (.dylib)

  • Automatically adds platform-specific filename decorations like lib prefix or .dll/.so suffix

  • Throws specific exceptions (load_error, symbol_error) on failure

#include "DynamicLibraryLoader.hpp"

using namespace helpers;

DynamicLibraryLoader loader("Zentitle2Core");

auto generateFingerprint = loader.get_function<bool(char*, int*, int)>("generateDeviceFingerprint");

char buffer[128] = {};
int length = 0;
bool result = generateFingerprint(buffer, &length, 0);

if (result) {
    std::cout << "Generated fingerprint: " << std::string(buffer) << std::endl;
}

Using Zentitle2Core Methods from the SDK

To simplify the integration with the low-level Zentitle2Core dynamic library, the SDK provides an internal base class called BaseManager which is located in Zentitle2CoreLibrary project. It serves as a common abstraction layer for all components that interact with native functions and symbols exposed by the core library.

This wrapper is not intended for direct use in application code. Instead, it provides reusable mechanisms for:

  • Centralized configuration and symbol loading

  • Safe execution with robust exception handling

  • Simplified access to function pointers from the native shared library


Responsibilities

  1. Library Configuration The BaseManager uses a static CoreLibraryManagerConfigProvider to store the location and name of the dynamic library. It must be configured before using any feature that depends on the core library.

    BaseManager::setLibraryConfig(configProvider);
  2. Error Handling All calls to native code should be wrapped using:

    BaseManager::executeAndHandleCoreError([] {
        // call native function
    });

    This ensures that:

    • Exceptions from the dynamic loader are caught and wrapped into Zentitle2CoreException

    • Standard and unknown exceptions are gracefully translated into safe SDK exceptions

    • Your application logic remains clean and protected from platform-specific errors

  3. Function Resolution To retrieve a pointer to a native function, use:

    auto func = getLibraryFunction<SignatureType>("functionName");

    This will:

    • Load the dynamic library on demand using DynamicLibraryLoader

    • Look up the requested function symbol

    • Throw an exception if the symbol or library is missing

Using Zentitle2Core Methods

Once the Zentitle2Core binaries are integrated into a C++ application, several advanced licensing features become available through the SDK.

Device Fingerprint

The Zentitle2Core library enables the generation of a device fingerprint — a unique identifier of the machine on which the application is running. This identifier is ideal for the activation’s seat ID, ensuring the license is bound to a specific device.

Offline Activation

The logic for encrypting and decrypting tokens used during the offline activation process is implemented within the Zentitle2Core library. Without the native library, offline licensing features cannot be utilized. The SDK relies on the Core library to securely handle these token exchanges.

Secure Storage

Persisting activation data securely and tamper-resistantly is a critical part of license enforcement. Zentitle2Core provides a secure storage mechanism that encrypts license files and ensures they are only valid on the original device and location. This prevents copying or moving the license to another environment. The library also assists in selecting the correct directory for storage, depending on the operating system. It supports predefined system folders such as USER_DATA and PUBLIC_DATA, allowing applications to choose the appropriate storage model based on their licensing policy.

Zentitle2Core integration exposes these capabilities in a high-level, cross-platform interface, allowing your application to enforce licensing constraints with minimal complexity and maximum security.

Last updated

Was this helpful?