Zentitle2Core Library
Last updated
Last updated
Zentitle2
Service terms© Copyright - Nalpeiron, all rights reserved Website use subject to Terms and Conditions. See our Privacy Policy Use of Zentitle is subject to our Service Terms and Conditions
The .NET Licensing Client implements bindings to the Zentitle2Core C++ library's methods, allowing .NET applications to leverage the functionality of the C++ Core library using the C# code.
Download the zip package with the Zentitle2Core binaries from the Zentitle2Core's Release Notes page.
Extract the content from the downloaded zip package. Depending on your needs and preferences, you can place the platform-specific binaries in the root directory of your project and ensure that they are always copied to the output/publish directory or provide a custom DllImportResolver.
In the example below, the application is targeting Windows OS. Thus, only the Windows binary has been included in the project.
This solution works for all the operation systems, as .NET runtime always loads the binary depending on the OS that the application is currently running (.dll
on Windows, .so
on Linux and .dylib
on MacOS).
The above approach has an issue when targeting MacOS with both the x86_64 and arm64 architectures. The Zentitle2Core binaries must be explicitly compiled for each architecture but have the same .dylib extension. For that reason, it's not possible to place them both in the project's root directory, and a Custom DllImportResolver must be used.
For the cases when you want to target operation systems with multiple architectures or you don't want to place the Zentite2Core binaries into the project's root directory, a custom DllImportResolver can be implemented that loads the correct library depending on your project's structure.
For the default Zentitle2Core release structure, the following Zentitle2CoreDllImportResolver
implementation would work:
The following code must be executed before the first use of the Zentitle2Core library to instruct the .NET runtime to use the custom DllImportResolver when loading the binaries.
After the Zentitle2Core binaries have been integrated into the .Net application, the following activation options can be used to leverage the functionality implemented in the Core library.
A Device Fingerprint is a unique identifier of the device on which the application is being executed. Therefore, it is a good candidate for use as the activation's seat ID.
The Zentitle2Core library implements the logic responsible for encrypting and decrypting the tokens exchanged in the Offline License Activation process. Without the Zentitle2Core library, this functionality cannot be used.
It is not trivial to persist the activation's details into a license file that is hard to tamper and should not work on a different device (or even in a different folder within the same machine). The Zentitle2Core library implements this functionality using low-level code, making the license file encrypted and unusable when copied/moved elsewhere.
Secure storage also helps place the file into the correct system directory, depending on the OS that the application is currently running on. It provides predefined directories USER_DATA
and PUBLIC_DATA
. Depending on the application's licensing model, you can decide which one to use.
The code below will create the ../{USER_DATA Dir}/YourAppName/.license
file for your app.