Documentation ¶
Index ¶
- Constants
- func SHA1(token, timestamp, nonce, encrypt string) string
- func WechatCryptorRandomStr() string
- type WechatCryptor
- func (cryptor *WechatCryptor) Decrypt(text string) (string, error)
- func (cryptor *WechatCryptor) DecryptMsg(msgSign, timeStamp, nonce, postData string) (string, error)
- func (cryptor *WechatCryptor) DecryptMsgContent(msgSign, timeStamp, nonce, encrypt string) (string, error)
- func (cryptor *WechatCryptor) Encrypt(randomStr, text string) (string, error)
- func (cryptor *WechatCryptor) EncryptMsg(msg, timeStamp, nonce string) (string, error)
- func (cryptor *WechatCryptor) EncryptMsgContent(msg, timeStamp, nonce string) (string, string, string, string, error)
- func (cryptor *WechatCryptor) String() string
- type WechatCryptorError
- type WechatCryptorPostBody
Constants ¶
View Source
const ComputeSignatureError int = -40003
View Source
const DecryptAESError int = -40007
View Source
const EncryptAESError int = -40006
View Source
const IllegalAesKey int = -40004
View Source
const IllegalBuffer int = -40008
View Source
const OK int = 0
View Source
const ParseXmlError int = -40002
View Source
const ValidateAppidError int = -40005
View Source
const ValidateSignatureError int = -40001
View Source
const WechatCryptorEncryptMsgFormat = `` /* 148-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type WechatCryptor ¶
type WechatCryptor struct {
// contains filtered or unexported fields
}
func NewWechatCryptor ¶
func NewWechatCryptor(appId, token, encodingAesKey string) (*WechatCryptor, error)
构造函数 appId 公众平台appid token 公众平台上,开发者设置的token aesKey 公众平台上,开发者设置的EncodingAESKey
func (*WechatCryptor) Decrypt ¶
func (cryptor *WechatCryptor) Decrypt(text string) (string, error)
对密文进行解密
func (*WechatCryptor) DecryptMsg ¶
func (cryptor *WechatCryptor) DecryptMsg(msgSign, timeStamp, nonce, postData string) (string, error)
func (*WechatCryptor) DecryptMsgContent ¶ added in v0.0.4
func (cryptor *WechatCryptor) DecryptMsgContent(msgSign, timeStamp, nonce, encrypt string) (string, error)
func (*WechatCryptor) Encrypt ¶
func (cryptor *WechatCryptor) Encrypt(randomStr, text string) (string, error)
对明文进行加密
func (*WechatCryptor) EncryptMsg ¶
func (cryptor *WechatCryptor) EncryptMsg(msg, timeStamp, nonce string) (string, error)
func (*WechatCryptor) EncryptMsgContent ¶ added in v0.0.4
func (*WechatCryptor) String ¶ added in v0.0.2
func (cryptor *WechatCryptor) String() string
type WechatCryptorError ¶
type WechatCryptorError struct {
Code int
}
* 异常的错误码和具体的错误信息
func (*WechatCryptorError) Error ¶
func (e *WechatCryptorError) Error() string
Click to show internal directories.
Click to hide internal directories.