BaseWeixinWXXClientCrypto

package
v5.1.34 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesECBDecrypt

func AesECBDecrypt(ciphertext, key []byte) (plaintext []byte, err error)

AesECBDecrypt CBC解密数据

@ciphertext 加密数据 @key 商户支付密钥

func CBCDecrypt

func CBCDecrypt(ssk, data, iv string) (bts []byte, err error)

CBCDecrypt CBC解密数据

@ssk 通过 Login 向微信服务端请求得到的 session_key @data 小程序通过 api 得到的加密数据(encryptedData) @iv 小程序通过 api 得到的初始向量(iv)

func CBCEncrypt

func CBCEncrypt(key, data string) (ciphertext []byte, err error)

CBCEncrypt CBC加密数据

func MD5

func MD5(str string) (string, error)

MD5 加密

func PKCS5Padding

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

PKCS5Padding 补位 Golang AES没有64位的块, 如果采用PKCS5, 那么实质上就是采用PKCS7

func PKCS5UnPadding

func PKCS5UnPadding(plaintext []byte) ([]byte, error)

PKCS5UnPadding 反补 Golang AES没有64位的块, 如果采用PKCS5, 那么实质上就是采用PKCS7

func SignByMD5

func SignByMD5(data map[string]string, key string) (string, error)

SignByMD5 多参数通过MD5签名

func Validate

func Validate(rawData, ssk, signature string) bool

Validate 对数据包进行签名校验,确保数据的完整性。

@rawData 不包括敏感信息的原始数据字符串,用于计算签名。 @signature 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息 @ssk 微信 session_key

Types

This section is empty.

Jump to

Keyboard shortcuts

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