Skip to Content
New release 12 available 🎉
LicensingNative SDK: Rust, Go, C++ and Python

Native licensing in Rust, Go, C++ and Python

Babel Licensing Native SDK 12.2.0 (C ABI 2) is available for macOS arm64, Linux x64 and Windows x64. The setup script downloads the pinned archive for your platform and verifies its SHA-256 before installation.

These examples add offline license verification to your own application. They use the same C ABI and signed demo files, so you can compare the language integrations without running a Licensing Service.

The native SDK is available for macOS arm64, Linux x64 and Windows x64. It verifies XML and compact licenses, checks absolute license/feature expiry, and provides online activation/validation/deactivation and floating acquire/heartbeat/release. Stateful trial, domain, usage and custom restrictions are refused.

Download and run

git clone https://github.com/babelfornet/native-licensing-examples.git cd native-licensing-examples python3 scripts/setup-sdk.py

The setup script downloads the pinned platform archive and verifies its SHA-256 before installing the SDK in .sdk. For a previously downloaded ZIP, use --archive /absolute/path/to/sdk.zip. There is one SDK runtime library; Botan is embedded.

ExampleRun
Rust integration guide./run.sh rust
Go integration guide./run.sh go
C++ integration guide./run.sh cpp
Python integration guide./run.sh python

Use Python 3.9+ for setup and install the language toolchain for your platform. C++ and Go/cgo require a C/C++ compiler; Rust requires Cargo and a linker. Windows Go/cgo needs a MinGW-compatible GCC or Clang. The guides include macOS, Linux and PowerShell commands. Client applications have no .NET dependency.

Each default run accepts demo/perpetual.xml and prints:

License verified. Feature Pro enabled.

Trial and purchased application licenses

./run.sh rust demo/trial.xml ./run.sh go demo/perpetual.xml

The trial file has an absolute expiry. The perpetual file has no license expiry. Both are signed for the example application, using its own publisher key. They are not Babel Obfuscator product licenses. The static trial expires in 2099 so that you can continue to run the repository’s demo; use the optional issuer for a real trial duration.

To sign your own files, use the Babel Licensing .NET components supplied with your trial or purchased SDK:

dotnet run --project issuer/Issuer.csproj \ -p:BabelLicensingDirectory=/absolute/path/to/your/sdk/assemblies \ -- issued 30 ./run.sh python issued/trial.xml issued/publisher-key.txt RSA Pro ./run.sh cpp issued/perpetual.xml issued/publisher-key.txt RSA Pro

The issuer requires .NET 10 and the directory containing the managed SDK’s Babel.Licensing.dll. Its cryptography is merged into that assembly; a separate Crypto.dll is not required. See Client components for installation. It writes a private key under issued/private/ and a separate public-key file. Keep the private key on the publisher’s machine. Distribute the signed customer file and pin the public key in your application.

All four clients accept the same arguments:

[license.xml [publisher-key.txt [RSA|ECDSA [feature]]]]

For example, test an existing customer XML license using your own publisher key:

./run.sh python /absolute/path/customer.xml /absolute/path/publisher-key.txt RSA Pro

Check refusal paths

./run.sh python demo/expired.xml ./run.sh python demo/no-feature.xml ./run.sh python demo/restricted.xml

These commands exit with a nonzero status. The expired file returns status 10. The file without Pro cannot enable that feature. The stateful trial in restricted.xml returns status 4 because its restriction is not supported by the native SDK.

Editing a signed field or providing another publisher’s public key also fails. The examples do not fall back to a key embedded in the license.

Run the complete sample check:

python3 scripts/test-examples.py

It tests seven scenarios in each language: perpetual, trial, expired, missing feature, unsupported restriction, edited content and wrong publisher key.

The repository README  describes ABI version 2, status codes, input limits and the supported subset. The native SDK page explains validation order and the separate role of maintenance and release identity.

Activation and floating on every platform

Every language includes the same native session workflow. Follow its guide to configure your publisher key, service endpoint, machine/client identity and application user key. A loopback-only protocol fixture is supplied for local trials without a database or production server.

python3 scripts/demo-service.py # In another terminal, with the documented demo environment: python3 scripts/run-example.py rust --online activation python3 scripts/run-example.py rust --online floating

Replace rust with go, cpp or python. On Windows use python and the PowerShell environment settings from the language guide. Activation verifies the signed hardware binding, checks the grant, validates with the service and deactivates. Floating acquires a seat, renews it twice and releases it. Production applications must renew for their entire protected session and stop use on any failed check/heartbeat; no offline grace or automatic background renewal is implied.

The supplied fixture serves signed demo payloads and disposable credentials. It is not a licensing server or issuer. Trial users and purchasers integrate the same client code with their own application licenses and Licensing Service.

Run python3 scripts/test-examples.py and python3 scripts/test-online-examples.py (python on Windows) to verify the accepted and refused paths in all four languages.

Last updated on