Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(licenseData ILicenseData, privateKeyData []byte) (string, error)
Generate encrypt and sign a license with a private key
func ReadPrivateKeyContents ¶
func ReadPrivateKeyContents(contents []byte) (*rsa.PrivateKey, error)
ReadPrivateKeyContents reads a PEM-encoded X.509 RSA private key and returns a rsa.PrivateKey that can be used in GenerateFromPayload to generate a license key from a payload.
Types ¶
type ILicenseData ¶
ILicenseData is a top interface for any potential licensing data which must be validated
type MyrteaLicenseData ¶
type MyrteaLicenseData struct { Serial string Company string Project string ContactName string ContactEmail string DateIssued time.Time DateExpires time.Time IssuedBy string }
MyrteaLicenseData is the default data structure for Myrtea licenses
func NewMyrteaLicenseData ¶
func NewMyrteaLicenseData(company string, project string, contactName string, contactEmail string, duration time.Duration, issuedBy string) MyrteaLicenseData
NewMyrteaLicenseData returns a new filled MyrteaLicenseData object
func (MyrteaLicenseData) Validate ¶
func (ld MyrteaLicenseData) Validate() (bool, error)
Validate checks if the license is valid. A Myrtea license is valid if : * It's not expired (DateExpires < Now)
Click to show internal directories.
Click to hide internal directories.