crypt

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(sessionKey, encryptedData, iv string) ([]byte, error)

Decrypt 解密加密信息获取微信用户信息

Types

type CBCEncryptor added in v0.2.0

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

CBCEncryptor 加解密核心类

func (*CBCEncryptor) Decrypt added in v0.2.0

func (p *CBCEncryptor) Decrypt(text, appid string) ([]byte, error)

Decrypt 解密

func (*CBCEncryptor) Encrypt added in v0.2.0

func (p *CBCEncryptor) Encrypt(text, appid string) (string, error)

Encrypt 加密

type EncryptResult added in v0.2.0

type EncryptResult struct {
	Encrypt      string `xml:"Encrypt" json:"Encrypt"`
	MsgSignature string `xml:"MsgSignature" json:"MsgSignature"`
	Timestamp    string `xml:"Timestamp" json:"Timestamp"`
	Nonce        string `xml:"Nonce" json:"Nonce"`
}

type PKCS7Encoder added in v0.2.0

type PKCS7Encoder struct {
	BlockSize int
}

PKCS7Encoder PKCS7填充

func (*PKCS7Encoder) Decode added in v0.2.0

func (p *PKCS7Encoder) Decode(decrypted []byte) []byte

Decode PKCS7去除填充

func (*PKCS7Encoder) Encode added in v0.2.0

func (p *PKCS7Encoder) Encode(text []byte) []byte

Encode PKCS7填充

type WXBizMsgCrypt added in v0.2.0

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

WXBizMsgCrypt 微信消息加解密主类

func NewBizMsgCrypt added in v0.2.0

func NewBizMsgCrypt(appId, token, encodingAESKey string) (*WXBizMsgCrypt, error)

NewBizMsgCrypt 创建WXBizMsgCrypt实例

func (*WXBizMsgCrypt) Decrypt added in v0.2.0

func (w *WXBizMsgCrypt) Decrypt(msgSignature, timestamp, nonce, body string) ([]byte, error)

Decrypt 解密消息

func (*WXBizMsgCrypt) Encrypt added in v0.2.0

func (w *WXBizMsgCrypt) Encrypt(replyMsg, nonce string, timestamp ...string) (*EncryptResult, error)

Encrypt 加密消息

type XMLParse added in v0.2.0

type XMLParse struct{}

XMLParse XML解析和生成

Jump to

Keyboard shortcuts

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