Tag: golang

Golang software licensing

Today, we have released a library for Golang, freely available on GitHub. It supports both key verification and offline verification. To verify a license key, the code below can be used:

token := "Access token"
publicKey := "RSA Public key"

licenseKey, err := cryptolens.KeyActivate(token, cryptolens.KeyActivateArguments{
	ProductId:   3646,
	Key:         "MPDWY-PQAOW-FKSCH-SGAAU",
	MachineCode: "289jf2afs3",
})
if err != nil || !licenseKey.HasValidSignature(publicKey) {
	fmt.Println("License key activation failed!")
	return
}

More examples can be found here.