Documentation ¶
Overview ¶
Package license holds functions related to paid product activation.
Index ¶
- Variables
- func AdminGenerateKeys() (*ecdsa.PrivateKey, error)
- func AdminLoadPrivateKey(privateFile string) (*ecdsa.PrivateKey, error)
- func AdminLoadPublicKey(publicFile string) (*ecdsa.PublicKey, error)
- func AdminSignRegistration(key *ecdsa.PrivateKey, reg Registration) (string, error)
- func AdminWriteKeys(key *ecdsa.PrivateKey, privateFile, publicFile string) error
- func IsRegistered() bool
- func ParsePublicKeyPEM(keytext string) (*ecdsa.PublicKey, error)
- type Registration
Constants ¶
This section is empty.
Variables ¶
var (
ErrRegisteredFeature = errors.New("feature not available")
)
Errors
var Signer *ecdsa.PublicKey
Functions ¶
func AdminGenerateKeys ¶
func AdminGenerateKeys() (*ecdsa.PrivateKey, error)
AdminGenerateKeys generates the ECDSA public and private key pair for the admin side of creating signed license files.
func AdminLoadPrivateKey ¶
func AdminLoadPrivateKey(privateFile string) (*ecdsa.PrivateKey, error)
AdminLoadPrivateKey loads the private key from disk.
func AdminLoadPublicKey ¶
AdminLoadPublicKey loads the private key from disk.
func AdminSignRegistration ¶
func AdminSignRegistration(key *ecdsa.PrivateKey, reg Registration) (string, error)
AdminSignRegistration signs the registration object.
func AdminWriteKeys ¶
func AdminWriteKeys(key *ecdsa.PrivateKey, privateFile, publicFile string) error
AdminWriteKeys writes the admin signing key to .pem files on disk.
func IsRegistered ¶
func IsRegistered() bool
IsRegistered returns a boolean answer: is the product registered?
Types ¶
type Registration ¶
type Registration struct { Name string `json:"name"` Email string `json:"email"` jwt.StandardClaims }
Registration object encoded into a license key file.
func GetRegistration ¶
func GetRegistration() (Registration, error)
GetRegistration returns the currently registered user, by checking for the license.key file in the profile folder.
func UploadLicenseFile ¶
func UploadLicenseFile(filename string) (Registration, error)
UploadLicenseFile handles the user selecting the license key file, and it is validated and ingested.