machine

package
v0.0.0-...-eef8a56 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: EPL-1.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const PUBLICKEY = `` /* 454-byte string literal not displayed */

Variables

This section is empty.

Functions

func ENdata

func ENdata(s1 string, num int) (string, string, error)

取嵌入日期

func GetCode

func GetCode() (string, error)

组合机械码

func Indata

func Indata(s1 string, in []byte, num int) string

嵌入日期

func LoadprivateKeyPEM

func LoadprivateKeyPEM(privateKeyPEM []byte, encrypted string) (string, error)

私钥解密

func LoadpublicKeyPEM

func LoadpublicKeyPEM(publicKeyPEM []byte, data string) (string, error)

公钥加密

Types

type FixedRand

type FixedRand struct {
	// contains filtered or unexported fields
}

FixedRand 固定随机数生成器

func NewFixedRand

func NewFixedRand(seed int64) *FixedRand

NewFixedRand 创建固定随机数生成器

func (*FixedRand) Read

func (f *FixedRand) Read(p []byte) (n int, err error)

Read 实现 io.Reader 接口

type RSAMachineCodeEncryptor

type RSAMachineCodeEncryptor struct {
	// contains filtered or unexported fields
}

RSAMachineCodeEncryptor RSA加密器

func NewRSAMachineCodeEncryptor

func NewRSAMachineCodeEncryptor(seed int64, keySize int) (*RSAMachineCodeEncryptor, error)

NewRSAMachineCodeEncryptor 创建RSA加密器

func (*RSAMachineCodeEncryptor) DecryptWithPrivateKey

func (r *RSAMachineCodeEncryptor) DecryptWithPrivateKey(encrypted string) (string, error)

DecryptWithPrivateKey 使用私钥解密

func (*RSAMachineCodeEncryptor) EncryptWithPublicKey

func (r *RSAMachineCodeEncryptor) EncryptWithPublicKey(data string) (string, error)

EncryptWithPublicKey 使用公钥加密

func (*RSAMachineCodeEncryptor) ExportKeysToPEM

func (r *RSAMachineCodeEncryptor) ExportKeysToPEM() (string, string, error)

ExportKeysToPEM 导出密钥为PEM格式

func (*RSAMachineCodeEncryptor) LoadKeysFromPEM

func (r *RSAMachineCodeEncryptor) LoadKeysFromPEM(privateKeyPEM, publicKeyPEM string) error

func (*RSAMachineCodeEncryptor) SignMachineCode

func (r *RSAMachineCodeEncryptor) SignMachineCode(machineCode string) (string, error)

SignMachineCode 对机器码进行数字签名

func (*RSAMachineCodeEncryptor) VerifySignature

func (r *RSAMachineCodeEncryptor) VerifySignature(machineCode, signature string) error

VerifySignature 验证数字签名

Jump to

Keyboard shortcuts

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