doodle/pkg/license/config.go
Noah Petherbridge 0449737607 License Key Registration with ECDSA JWT Tokens
* New command-line tool: doodle-admin for signing license keys for
  users. Includes functions to initialize a keypair, sign license keys
  and validate existing keys.
* The Main Menu screen shows a blue "Register Game" button in the bottom
  right corner of the screen, for unregistered users only.
* In Edit Mode, there is a "Help -> Register" menu item that opens the
  License Window.
* The License UI Window lets the user select the license.key file to
  register the game with. If registered, a copy of the key is placed in
  Doodle's profile directory and the licensee name/email is shown in the
  License UI window.
* Unregistered games will show the word "(shareware)" next to the title
  screen version number and Edit Mode status bar.
* No restrictions are yet placed on free versions of the game.
2021-06-16 21:56:30 -07:00

26 lines
553 B
Go

package license
import (
"crypto/ecdsa"
"fmt"
)
// Run-time configuration variables provided by the application.
const pemSigningKey = `-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEMrqAMHjZ1dPlKwDOsiCSr5N3OSvnYKLM
efe2xD+5hJYrpvparRFnaMbMuqde4M6d6sCCKO8BHtfAzmyiQ/CD38zs9MiDsamy
FDYEEJu+Fqx482I7fIa5ZEE770+wWJ3k
-----END PUBLIC KEY-----`
var Signer *ecdsa.PublicKey
func init() {
key, err := ParsePublicKeyPEM(pemSigningKey)
if err != nil {
fmt.Printf("license: failed to parse app keys: %s\n", err)
return
}
Signer = key
}