Perl still runs a great deal of quiet, valuable, long-lived commercial software — bioinformatics pipelines, publishing and prepress systems, network and telecoms tooling, in-house ERP that outlived three CIOs. Much of it is installed on the customer’s own server, which is exactly where a dongle earns its place: they hold your source, and a licence file is a file, which copies.
Reading a license
use KeyNub::LicDongle qw($SCOPE_DEVELOPER);
my $dongle = KeyNub::LicDongle->open; # first dongle, or ->open($serial)
$dongle->verify_genuine; # dies unless genuine
$dongle->session_open;
my $license = $dongle->record_read('license');
$dongle->session_close;
$dongle->close;Code language: Perl (perl)
The binding is dongle-centric rather than session-object-centric: the session, record and app-crypto calls all hang off the dongle. That keeps the object count down in a language where most people are writing a script rather than an architecture. Failures die, so one eval covers a whole sequence, and $@ carries the SDK’s own diagnostic text.
Setup
Perl 5.20+ and FFI::Platypus, which is the only dependency. Point it at the library with KEYNUB_LICDONGLE_FLAT_LIBRARY — note the flat: this binding goes through the flat companion API, so it wants keynub_licdongle_flat rather than the core library. Pointing it at the wrong one reports a missing licdf_ symbol, which is not an obvious way of saying “wrong library”.
The rule that holds in every language: do not branch on a boolean. Encrypt data your program genuinely needs with appEncrypt when you build the product, decrypt it through the dongle at run time, and removing the check leaves the program with nothing to compute rather than a working unlicensed copy.
Code
Runnable sample: perl/verify_and_read.pl. Binding source: bindings/perl. Both are Apache-2.0, in the public SDK repository; the prebuilt native library is attached to each release.
All supported languages · All industries · Buy a KeyNub · Ask us something