package keynub-licdongle

  1. Overview
  2. Docs
Client for the KeyNub USB license dongle

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v1.1.1.tar.gz
sha256=2da47ccb0e29d07544d7a648de8234604819d5c78759b886d25d17426f2ae2c4
sha512=d8528b419af45fc42644db810f11f57f88508972d5fe52a16850f6dc81d04a67d81b7981e35e153cf0877df1d6f6f311a11e5bc4583ad9a4d255849bfc5951cf

doc/README.html

KeyNub License Dongle SDK

Host SDK for the KeyNub USB-C license dongle — language bindings and samples over one core C library (keynub_licdongle, prefix licd_) with a stable C ABI. Windows, Linux and macOS, with no driver to install: the dongle is a vendor-defined USB HID device.

NuGet PyPI npm crates.io RubyGems LuaRocks Packagist Maven Central Go module Julia General pub.dev Swift Package Index Nimble CPAN Lazarus OPM CMake package xmake NuGet File Exchange

Getting started

  1. Pick the native library for your platform from natives/NATIVES.md says which file is which.
  2. Install the binding for your language, or drop its source into your project.
  3. Enumerate, verify, open a session, read your licence data. Each binding's README shows the whole flow in a dozen lines.

The API surface is the same everywhere, because every binding is a thin layer over the same ABI — declared in include/licdongle.h. Learn it once.

Languages

Language

Binding

Sample

Package

C

include/licdongle.h — CMake target keynub::licdongle

samples/c

CMake package NuGet xmake

C++

bindings/cpp — header-only RAII, C++11, CMake target keynub::licdongle_cpp

samples/cpp

CMake package NuGet xmake

flat API

bindings/flat — integer handles, no callbacks

samples/flat

C# / VB.NET / F#

bindings/dotnetKeyNub.LicenseDongle

samples/csharp, samples/vbnet, samples/fsharp

NuGet

Python

bindings/pythonkeynub-licdongle, ctypes, plus the licd-tool CLI

samples/python

PyPI

Java

bindings/java — JNA, Java 17+

samples/java

Maven Central

Delphi / Free Pascal

bindings/delphi

samples/delphi

Lazarus OPM

Visual Basic 6 / VBScript

bindings/com — COM object KeyNub.Dongle

samples/vb6

twinBASIC

bindings/com

samples/twinbasic

Excel / VBA

bindings/vba

samples/vba

MATLAB / Simulink

bindings/matlab — MEX gateway, incl. MATLAB Coder output; runs in GNU Octave

samples/matlab, samples/simulink

File Exchange

Wolfram Language

bindings/wolfram — paclet over ForeignFunctionLoad, flat API

samples/wolfram

LabVIEW

bindings/labview — VI library (LabVIEW 2026, 64-bit) and the import header

samples/labview

Node.js / Electron

bindings/nodejs@keynub/licdongle

samples/nodejs

npm

Go

bindings/go — cgo, errors.Is sentinels

samples/go

Go module

Rust

bindings/rustkeynub-licdongle, no dependencies

samples/rust

crates.io

Ruby

bindings/ruby — stdlib Fiddle, no gems

samples/ruby

RubyGems

PHP

bindings/php — bundled FFI, no PECL module

samples/php

Packagist

Perl

bindings/perlFFI::Platypus

samples/perl

CPAN

Lua

bindings/lua — LuaJIT FFI

samples/lua

LuaRocks

Fortran

bindings/fortran — F2003 iso_c_binding

samples/fortran

COBOL

bindings/cobol — copybook, GnuCOBOL

samples/cobol

Ada

bindings/ada — Alire crate keynub_licdongle, library loaded at run time

samples/ada

Zig

bindings/zig@cImport compiles the real header

samples/zig

Swift

bindings/swiftKeyNubLicDongle, SwiftPM package at the repository root

samples/swift

Swift Package Index

Dart / Flutter

bindings/dartkeynub_licdongle, dart:ffi

samples/dart

pub.dev

Julia

bindings/juliaccall, no packages

samples/julia

Julia General

R

bindings/rKeyNubLicDongle, a C layer compiled at install

samples/r

Haskell

bindings/haskellkeynub-licdongle, pure Haskell over the flat API

samples/haskell

OCaml

bindings/ocamlkeynub-licdongle, ctypes-foreign over the flat API

samples/ocaml

Nim

bindings/nimimportc over dynlib

samples/nim

Nimble

Every sample carries the exact command that builds and runs it in its header comment, including which native library it wants. All of them except Excel/VBA and LabVIEW were compiled and run against a software dongle before release; those two need Excel and a licensed LabVIEW respectively, so they are written against the API and reviewed rather than executed. LabVIEW also has a ready-made VI library (bindings/labview/keynub_licdongle, saved in LabVIEW 2026, 64-bit), whose VIs were run in LabVIEW against the shipped library; Excel ships a .bas rather than an .xlsm so that the code can be reviewed in a diff.

Environments that cannot express the core ABI — LabVIEW, VBA, COBOL — go through a flat companion API (bindings/flat): one self-contained library with integer handles, caller-allocated buffers and no callbacks.

Visual Basic 6 gets a COM object rather than Declare statements for a specific reason: VB6's Declare emits stdcall while the flat API is cdecl. That is harmless in a 64-bit process and a stack-drifting mismatch in a 32-bit one, and VB6 is 32-bit only. Going through an object removes the question — and adds a handle that closes itself and failures that raise with a real Err.Description.

Where the licence check belongs

The shortest useful version of docs/integration-security.md:

// Weak — one patched branch defeats it, in any language.
if (dongle.IsGenuine) enableFeature();

// Strong — the data your program needs only exists with the dongle present.
coefficients = dongle.AppDecrypt(blobShippedWithYourInstaller);

Encrypt the constants, tables, thresholds or key material your application genuinely cannot compute. Ship them encrypted. Decrypt them through the dongle at run time. Then removing the check does not unlock the feature — it removes the feature's input.

Trust root

verify_genuine validates the device certificate chain against the KeyNub production root CA, whose public certificate is compiled into the released library — so a substituted device fails verification and your application supplies nothing and manages no root. licd_set_trust_root (or the equivalent on your binding) overrides the built-in root, which only vendor tooling needs.

Licence

Everything in this repository — the bindings, the samples and the C ABI header — is Apache-2.0. See LICENSE, NOTICE and THIRD-PARTY-NOTICES.txt for the dependency licence elections.

The prebuilt native libraries in natives/ are not covered by that licence; their terms are in BINARY-LICENSE.txt. You can use them from an Apache-2.0 binding in a closed-source application either way — that is what they are for.

Security reports: SECURITY.md.

Linux

Install packaging/linux/99-keynub-dongle.rules into /etc/udev/rules.d/ so the device is reachable without root. It is a permission rule, not a driver — nothing is compiled or loaded into the kernel.