Documentation
¶
Index ¶
- Constants
- func ENdata(s1 string, num int) (string, string, error)
- func GetCode() (string, error)
- func Indata(s1 string, in []byte, num int) string
- func LoadprivateKeyPEM(privateKeyPEM []byte, encrypted string) (string, error)
- func LoadpublicKeyPEM(publicKeyPEM []byte, data string) (string, error)
- type FixedRand
- type RSAMachineCodeEncryptor
- func (r *RSAMachineCodeEncryptor) DecryptWithPrivateKey(encrypted string) (string, error)
- func (r *RSAMachineCodeEncryptor) EncryptWithPublicKey(data string) (string, error)
- func (r *RSAMachineCodeEncryptor) ExportKeysToPEM() (string, string, error)
- func (r *RSAMachineCodeEncryptor) LoadKeysFromPEM(privateKeyPEM, publicKeyPEM string) error
- func (r *RSAMachineCodeEncryptor) SignMachineCode(machineCode string) (string, error)
- func (r *RSAMachineCodeEncryptor) VerifySignature(machineCode, signature string) error
Constants ¶
View Source
const PUBLICKEY = `` /* 454-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func LoadprivateKeyPEM ¶
私钥解密
Types ¶
type FixedRand ¶
type FixedRand struct {
// contains filtered or unexported fields
}
FixedRand 固定随机数生成器
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 验证数字签名
Click to show internal directories.
Click to hide internal directories.