license

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSignature is a ...
	ErrInvalidSignature = errors.New("invalid signature")

	// ErrMalformedLicense is a ...
	ErrMalformedLicense = errors.New("malformed license")
)

Functions

func DecodePrivateKey

func DecodePrivateKey(data []byte) (ed25519.PrivateKey, error)

DecodePrivateKey is a ...

func DecodePublicKey

func DecodePublicKey(data []byte) (ed25519.PublicKey, error)

DecodePublicKey is a ...

func GetPrivateKey

func GetPrivateKey() ed25519.PrivateKey

GetPrivateKey is a ...

func GetPublicKey

func GetPublicKey() ed25519.PublicKey

GetPublicKey is a ...

Types

type KeyPair

type KeyPair struct {
	PublicKey  string
	PrivateKey string
}

KeyPair is a ...

func KeyPairGenerate

func KeyPairGenerate() *KeyPair

KeyPairGenerate is a ...

type License

type License struct {
	Iss string          `json:"iss,omitempty"` // Issued By
	Cus string          `json:"cus,omitempty"` // Customer ID
	Sub uint32          `json:"sub,omitempty"` // Subscriber ID
	Typ string          `json:"typ,omitempty"` // License Type
	Lim Limits          `json:"lim,omitempty"` // License Limit (e.g. Site)
	Iat time.Time       `json:"iat,omitempty"` // Issued At
	Exp time.Time       `json:"exp,omitempty"` // Expires At
	Dat json.RawMessage `json:"dat,omitempty"` // Metadata
}

License is a ...

func Decode

func Decode(data []byte, publicKey ed25519.PublicKey) (*License, error)

Decode is a ...

func (*License) Encode

func (l *License) Encode(privateKey ed25519.PrivateKey) ([]byte, error)

Encode is a ...

func (*License) Expired

func (l *License) Expired() bool

Expired is a ...

type Limits

type Limits struct {
	Tandem  bool `json:"tandem"`
	Triaxis bool `json:"triaxis"`
	Robots  bool `json:"robots"`
	Users   int  `json:"users"`
}

Limits is a ...

Jump to

Keyboard shortcuts

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