

#Runjs license key software#
there’s no software that you need to package with your app). Keygen is a typical HTTP JSON API service (i.e.

#Runjs license key license key#
you need additional user profile information, or you need to associate multiple licenses with a single user.īut in case you aren't particularly keen on writing and maintaining your own in-house licensing system, or you just don't want to deal with writing your own license key generator like the one above, I’m the founder of a software licensing API called Keygen which can help you get up and running quickly without having to write and host your own license server. I don't recommend user accounts unless you have a specific need for them, e.g. That's where a license server can come in.Ī license server can help manage a license's activation, expirations, among other things, such as user accounts used to associate multiple licenses or feature-licenses with a single user or team. Or perhaps the license key needs a renewable expiration date. 'valid' forever), or they call for more complicated licensing systems, such as one where only a limited number of devices (or seats) can use the app at one time. Sometimes requirements dictate that license keys are not perpetual (i.e. They're relatively simple, and they work great offline, but sometimes verifying that a license key is 'valid' isn't enough. Generating and verifying the authenticity of cryptographically signed license keys like this will work great for a lot of simple licensing needs. Verify the signature for the data using the public keyĬonst valid = verifier.verify(publicKey, signature, 'hex')

#Runjs license key code#
Then, to validate the license key within your Electron app, you would want to cryptographically 'verify' the key's authenticity by embedding the public (not the private!) key generated above into your application code base: // Split the license key's data and the signatureĬonst = licenseKey.split('.')Ĭonst data = om(encoded, 'base64').toString()Ĭonst verifier = crypto.createVerify('rsa-sha256') Using Node, that would look something like this: const crypto = require('crypto')Ĭonst ) their order number or an email address, and create a 'signature' of it using RSA cryptography. This can be done using cryptography, or it can be done by generating a 'random' license key string and storing it in a database and then building a CRUD licensing server that can verify that a given license key is "valid."įor cryptographic license keys, you can take some information from the customer, e.g. First, you would want to somehow generate a license key for each user. For most Electron apps, license keys will do just fine.Īdding license key (synonymous with product key) validation to an Electron app can be pretty straight forward. I previously would almost always recommended utilizing user accounts for licensing Electron apps, but I've since changed my position to be a little more nuanced. Edit for 2021: I'd like to revise this answer, as it has generated a lot of inquiries on the comparison I made between license keys and user accounts.
