Versions in this module Expand all Collapse all v0 v0.0.5 Feb 18, 2021 Changes in this version + var ComputeSignatureError = errors.New("ComputeSignatureError") + var DecodeBase64Error = errors.New("DecodeBase64Error") + var DecryptAESError = errors.New("DecryptAESError") + var EncodeBase64Error = errors.New("EncodeBase64Error") + var EncryptAESError = errors.New("EncryptAESError") + var GenReturnXmlError = errors.New("GenReturnXmlError") + var IllegalAesKey = errors.New("IllegalAesKey") + var IllegalBuffer = errors.New("IllegalBuffer") + var ParseXmlError = errors.New("ParseXmlError") + var ValidateAppidError = errors.New("ValidateAppidError") + var ValidateSignatureError = errors.New("ValidateSignatureError") + func GenerateResponseXML(encrypt, signature, timestamp, nonce string) (b []byte, err error) + func Sha1(token, timestamp, nonce, msg string) (ret string) + type EncryptedRequestXML struct + Encrypt string + ToUserName string + XMLName xml.Name + func ParseRequestXML(data []byte) (e EncryptedRequestXML, err error) + type EncryptedResponseXML struct + Encrypt string + MsgSignature string + Nonce string + TimeStamp string + XMLName xml.Name + func ParseResponseXML(data []byte) (e EncryptedResponseXML, err error) + type Encrypter struct + func NewEncrypter(token, encodingAesKey, appId string) (e *Encrypter, err error) + func (e *Encrypter) Decrypt(msgSignature, timestamp, nonce string, data []byte) (b []byte, err error) + func (e *Encrypter) Encrypt(replyMsg []byte) (b []byte, err error) + type PKCS7Encoder interface + Decode func([]byte) []byte + Encode func([]byte) []byte + type Prpcrypt struct + Encoder PKCS7Encoder + func NewPrpcrypt(key string) (p *Prpcrypt, err error) + func (p *Prpcrypt) Decrypt(appId string, src string) (ret []byte, err error) + func (p *Prpcrypt) Encrypt(appId string, src []byte) (ret string, err error) + type WechatErrorCode int + const ComputeSignatureErrorCode + const DecodeBase64ErrorCode + const DecryptAESErrorCode + const EncodeBase64ErrorCode + const EncryptAESErrorCode + const GenReturnXmlErrorCode + const IllegalAesKeyCode + const IllegalBufferCode + const ParseXmlErrorCode + const ValidateAppidErrorCode + const ValidateSignatureErrorCode