Skip to content

License Dongle SDK and Supported Languages

KeyNub ships as one core library with a stable C ABI, with thin bindings layered on top. That matters more than a long language list: the cryptography, the USB transport and the protocol live in one tested place, and a binding is a translation layer rather than a reimplementation. When we fix something, every language gets the fix.

The bindings, the samples and the C ABI header are Apache-2.0 licensed and published, so you can read exactly what your integration will look like before you buy: the API, the error handling and a working sample in your language. That is possible because the protection is the ECC key inside the dongle’s secure element, not secrecy about how you talk to it.

For the hardware the library talks to — USB identifiers, report size and throughput, the secure element, record and counter limits — see the one-page datasheet (PDF).

Switching from CodeMeter or Sentinel HL? Those two pages put KeyNub beside each, fact by fact, and map the concepts (containers, feature codes, runtime) to the SDK’s records, sessions and library.

Supported Languages

LanguageBindingSamplePackage
Cthe core library and its header directlysamples/cCMake package version badge NuGet version badge xmake version badge Bazel Central Registry version badge
C++header-only RAII wrapper, C++11samples/cppCMake package version badge NuGet version badge xmake version badge Bazel Central Registry version badge
C#one .NET assembly, KeyNub.LicenseDonglesamples/csharpNuGet version badge
VB.NETthe same .NET assemblysamples/vbnetNuGet version badge
F#the same .NET assemblysamples/fsharpNuGet version badge
PowerShellmodule KeyNub.LicenseDongle, Windows PowerShell 5.1 and PowerShell 7samples/powershellPowerShell Gallery version badge
Pythonctypes, plus the licd-tool CLIsamples/pythonPyPI version badge
JavaJNA, Java 17+samples/javaMaven Central version badge
Clojurecom.keynub/keynub-licdongle-clj, over the Java bindingsamples/clojureClojars version badge
Scalacom.keynub:keynub-licdongle-scala_3 on Maven Central, Scala 3 over the Java bindingsamples/scalaMaven Central (Scala) version badge Scaladex version badge
Kotlincom.keynub:keynub-licdongle-kotlin on Maven Central, Kotlin Multiplatform over the flat APIsamples/kotlinMaven Central (Kotlin) version badge klibs.io version badge
Groovythe Java binding com.keynub:keynub-licdongle, through @Grabsamples/groovy—
Delphi / Free Pascala Pascal unit over the C ABIsamples/delphiLazarus OPM version badge
Visual Basic 6COM object KeyNub.Donglesamples/vb6—
twinBASICthe same COM object, 32- or 64-bitsamples/twinbasic—
Excel / VBA / AccessDeclare PtrSafe module, or COMsamples/vba—
MATLAB / SimulinkMEX gateway, incl. MATLAB Coder outputsamples/matlab, samples/simulinkFile Exchange version badge
Wolfram Languagepaclet over ForeignFunctionLoad, no LibraryLink shimsamples/wolframWolfram Paclet Repository version badge
LabVIEWVI library (LabVIEW 2026) over Call Library Function nodessamples/labviewVIPM version badge
Node.js / Electron@keynub/licdongle, prebuilt nativessamples/nodejsnpm version badge Node-RED nodes version badge Node-RED Flow Library version badge
Deno@keynub/licdongle on JSR, Deno.dlopen over the flat APIsamples/denoJSR version badge
Go (Golang)cgo, errors.Is sentinelssamples/goGo module version badge
Rustkeynub-licdongle, no dependenciessamples/rustcrates.io version badge
Rubystdlib Fiddle, no gemssamples/rubyRubyGems version badge
PHPthe bundled FFI extensionsamples/phpPackagist version badge
PerlFFI::Platypussamples/perlCPAN version badge
LuaLuaJIT FFI, one filesamples/luaLuaRocks version badge
FortranFortran 2003 iso_c_bindingsamples/fortran—
COBOLa copybook over the flat APIsamples/cobol—
AdaAlire crate keynub_licdongle, library loaded at run timesamples/adaAlire version badge
Zig@cImport compiles the real headersamples/zigZigistry version badge
SwiftSwiftPM package at the repository root, library loaded at run timesamples/swiftSwift Package Index version badge
Dart / Flutterkeynub_licdongle on pub.dev, pure dart:ffisamples/dartpub.dev version badge
Juliaccall, no packagessamples/juliaJulia General version badge
RCRAN package KeyNubLicDongle, C layer compiled at installsamples/rCRAN version badge r-universe version badge
Nimimportc over dynlibsamples/nimNimble version badge
Haskellkeynub-licdongle on Hackage, pure Haskell over the flat APIsamples/haskellHackage version badge Stackage version badge
OCamlkeynub-licdongle on opam, ctypes-foreign over the flat APIsamples/ocamlopam version badge
Elixirkeynub_licdongle on Hex, a small NIF over the flat APIsamples/elixirHex version badge
Gleamkeynub_licdongle_gleam on Hex, typed Gleam over the Elixir packagesamples/gleamHex version badge
Dkeynub-licdongle on DUB, extern(C) over the flat API, nothing linkedsamples/dDUB version badge
Crystalkeynub_licdongle shard, function pointers over the flat API, nothing linkedsamples/crystalShardbox version badge shards.info version badge
Tclkeynub_licdongle, pure Tcl over cffi and the flat API, nothing compiledsamples/tclPublic Tcl Package Repository version badge Tcl/Tk Package Registry version badge
RakuKeyNub::LicDongle in the zef ecosystem, NativeCall over the flat APIsamples/rakuraku.land version badge
Racketkeynub-licdongle on pkgs.racket-lang.org, ffi/unsafe over the flat APIsamples/racketRacket packages version badge
Common LispASDF system keynub-licdongle, CFFI over the flat API, nothing linkedsamples/common-lispUltralisp version badge
SWI-Prologpack keynub_licdongle, a foreign module over the flat API, nothing linkedsamples/prologSWI-Prolog packs version badge
Vmodule keynub_licdongle, the dl module over the flat API, nothing linkedsamples/vvpm version badge
Odinpackage keynub_licdongle, core:dynlib over the flat API, nothing linkedsamples/odin—

Command-Line Tool

licd-tool is one executable with the core library built in: list and inspect dongles, verify them, read and write records, read and increment counters, and encrypt data that only a dongle can decrypt, from a script or a terminal. On Windows, choco install keynub-licd-tool installs the signed build for the machine’s architecture; the same builds are in the repository’s natives/ folder, and elsewhere it builds with CMake. pip install keynub-licdongle brings a licd-tool with the same commands.

Chocolatey version badge

Platforms and Architectures

The repository carries prebuilt native libraries for all of these, each listed with its SHA-256 in natives/MANIFEST.txt:

PlatformArchitectures
Windowsx64, 32-bit (x86), ARM64
Linuxx86_64, ARM64 (aarch64)
macOSone universal binary — Apple Silicon and Intel

There is no driver on any of them — the dongle is a standard USB HID device. On Linux you install a one-line udev rule, which grants your user access to the device; it is a permission rule, not a driver. On macOS the vendor-defined usage page means no Input Monitoring prompt.

When you pick a library, match the architecture of your host process, not of the machine. A 32-bit application on 64-bit Windows needs the x86 build, and on Windows on ARM a native ARM64 application needs the ARM64 build while an x64 application running under emulation needs the x64 one. It is the single most common integration problem, and none of its symptoms say so.

Every language on this page ships a working sample you can run as-is, and every binding comes with a stand-in test that exercises every call without a dongle.

Where You Put the Check Matters More Than Which Language You Use

The most common mistake in dongle integration is asking a yes/no question:

If IsGenuine() Then
    unlockEverything()
End If

One patched jump instruction defeats that, in any language. A dongle cannot stop someone editing your binary — so do not give them a single branch to edit. Instead, make the program need something only the dongle can produce:

coefficients = dongle.AppDecrypt(blobShippedWithYourInstaller)

Now the license check is not a gate in front of the feature; it is the feature’s input. Remove the dongle and the code does not run wrong, it has nothing to run on. The SDK documents this pattern for every binding, and the MATLAB and Simulink samples demonstrate it on real plant coefficients.

What a Typical Integration Looks Like

  • Enumerate and open the dongle (no driver install — it is a HID device)
  • Verify it is genuine, against the KeyNub root CA built into the SDK
  • Open an encrypted session
  • Read your license record, or decrypt data your application needs
  • Ship

Most integrations are a day’s work. If yours is not, tell us what got in the way — that is the kind of bug report we act on.

Looking for your industry rather than your language? See where a hardware license dongle fits — thirteen industries from CAM and CNC to medical, broadcast and machine vision.