license

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

README

license

授权证书基础库

Documentation

Index

Constants

View Source
const DefaultPublicKey = "1d858f2f7270a7fd1e51acc61251aa38f4ee6dc8f5973a50a11381279e5770be"

Variables

This section is empty.

Functions

func MachineID

func MachineID() (string, error)

Types

type License

type License struct {
	Product   string    `json:"product"`              //产品
	Domain    string    `json:"domain,omitempty"`     //域名,用于前端,支持多个
	MachineID string    `json:"machine_id,omitempty"` //机器ID,用于后端
	ExpireAt  time.Time `json:"expire_at,omitempty"`  //失效期

	Signature string `json:"signature,omitempty"` //签名
}

func (*License) Expired

func (l *License) Expired() bool

func (*License) Parse

func (l *License) Parse(lic string) error

func (*License) Serialize

func (l *License) Serialize() string

func (*License) Sign

func (l *License) Sign(privateKey string) error

func (*License) Stringify

func (l *License) Stringify() string

func (*License) Validate

func (l *License) Validate() error

func (*License) Verify

func (l *License) Verify(publicKey string) error

type Pair

type Pair struct {
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

func Generate

func Generate() (*Pair, error)

func (*Pair) Load

func (p *Pair) Load(name string) error

func (*Pair) Store

func (p *Pair) Store(name string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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