Skip to content

Latest commit

 

History

History

lkgen

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

lkgen

lkgen is a license generation and validation utility using the lk library as a backend.

It can be used standalone to generate cypto keys, sign and validate license keys.

Install it with the following command :

go install github.com/hyperboloide/lk/lkgen@latest

Complete flow example:

  1. Generate a private key file:
lkgen gen --output=./private.key
  1. Generate a public key to distribute with your app:
lkgen pub ./private.key --output=./pub.key
  1. Create the licence (here we use json but can be anything...):
echo '{"email":"[email protected]", "until":"2023-10-04"}' > license.tmp
  1. sign the license:
lkgen sign --input=./license.tmp --output=./license.signed private.key

The file license.signed is your redistributable license.

  1. validate the license:
lkgen verify --input=./license.signed ./pub.key
{"email":"[email protected]", "until":"2023-10-04"}
echo $?
0

Reference documentation

lkgen --help-long
usage: lkgen [<flags>] <command> [<args> ...]

A command-line utility to generate private keys and licenses.

Flags:
  --help  Show context-sensitive help (also try --help-long and --help-man).

Commands:
  help [<command>...]
    Show help.


  gen [<flags>]
    Generates a base32 encoded private key.

    -o, --output=OUTPUT  Output file (if not defined then stdout).

  pub [<flags>] <key>
    Get the public key.

    -o, --output=OUTPUT  Output file (if not defined then stdout).

  sign [<flags>] <key>
    Creates a license.

    -i, --input=INPUT    Input data file (if not defined then stdin).
    -o, --output=OUTPUT  Output file (if not defined then stdout).

  verify [<flags>] <key>
    Verifies a license.

    -i, --input=INPUT  Input license file (if not defined then stdin).