linkAesCrypt

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const KEY = "#HvL%$o0oNNoOZnk#o2qbqCeQB1iXeIR"

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(crypted, key []byte) ([]byte, error)

AES解密

func AesEncrypt

func AesEncrypt(origData, key []byte) ([]byte, error)

AES加密,CBC

func CreateLicense

func CreateLicense(data LicenseStruct) (rsp string, err error)

CreateLicense 生成license

func PKCS7Padding

func PKCS7Padding(ciphertext []byte, blockSize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

Types

type Function

type Function struct {
	Gps             bool `fmt:"gps"`
	OutOfBoundAlert bool `fmt:"outOfBoundAlert"`
}

type LicenseStruct

type LicenseStruct struct {
	CodeType    int64    `fmt:"codeType"`
	Customer    string   `fmt:"customer"`
	DeviceSN    string   `fmt:"deviceSN"`
	Expires     int64    `fmt:"expires"`
	Functions   Function `fmt:"functions"`
	ReleaseDate string   `fmt:"releaseDate"`
	Supplier    string   `fmt:"supplier"`
}

func GetByLicense

func GetByLicense(license string) (rsp *LicenseStruct, err error)

GetByLicense 根据license解码生成map[string]interface{}

Jump to

Keyboard shortcuts

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