license

package
v0.0.0-...-9dee689 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LicenseTierUnlicensed = "unlicensed"
	LicenseTierCommunity  = "community"
	LicenseTierIndividual = "individual"
	LicenseTierBusiness   = "business"
)

License tiers.

Variables

This section is empty.

Functions

func SetLegacyLicenseKey

func SetLegacyLicenseKey(s string) error

SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019. Will be removed at some point in a future major version.

func SetLicenseKey

func SetLicenseKey(content string, customerName string) error

SetLicenseKey sets and validates the license key.

Types

type LegacyLicense

type LegacyLicense struct {
	Name        string
	Signature   string `json:",omitempty"`
	Expiration  time.Time
	LicenseType LegacyLicenseType
}

LegacyLicense holds the old-style office license information.

func (LegacyLicense) Verify

func (l LegacyLicense) Verify(pubKey *rsa.PublicKey) error

Verify verifies a license by checking the license content and signature against a public key.

type LegacyLicenseType

type LegacyLicenseType byte

LegacyLicenseType is the type of license

type LicenseKey

type LicenseKey struct {
	LicenseId    string    `json:"license_id"`
	CustomerId   string    `json:"customer_id"`
	CustomerName string    `json:"customer_name"`
	Tier         string    `json:"tier"`
	CreatedAt    time.Time `json:"-"`
	CreatedAtInt int64     `json:"created_at"`
	ExpiresAt    time.Time `json:"-"`
	ExpiresAtInt int64     `json:"expires_at"`
	CreatorName  string    `json:"creator_name"`
	CreatorEmail string    `json:"creator_email"`
	UniPDF       bool      `json:"unipdf"`
	UniOffice    bool      `json:"office"`
	Trial        bool      `json:"trial"` // For trial licenses.
}

LicenseKey represents a license key for UniOffice.

func GetLicenseKey

func GetLicenseKey() *LicenseKey

func MakeUnlicensedKey

func MakeUnlicensedKey() *LicenseKey

MakeUnlicensedKey returns an unlicensed key.

func (*LicenseKey) IsLicensed

func (k *LicenseKey) IsLicensed() bool

IsLicensed returns true if the package is licensed.

func (*LicenseKey) ToString

func (k *LicenseKey) ToString() string

ToString returns a string representing the license information.

func (*LicenseKey) TypeToString

func (k *LicenseKey) TypeToString() string

TypeToString returns a string representation of the license type.

func (*LicenseKey) Validate

func (k *LicenseKey) Validate() error

Validate returns an error if the licenseis invalid, nil otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL