Documentation ¶
Index ¶
- func CheckSignature(t string, w http.ResponseWriter, r *http.Request) bool
- func CheckSignatureInQuery(t string, w http.ResponseWriter, r *http.Request) bool
- func MsgSign(token, timestamp, nonce, encryptedMsg string) (signature string)
- func Sign(token, timestamp, nonce string) (signature string)
- type Cipher
- type IOCipher
- type MessageCrypter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSignature ¶
func CheckSignatureInQuery ¶
Types ¶
type Cipher ¶
type Cipher struct { MessageCrypter // contains filtered or unexported fields }
用于管道加密
func (*Cipher) CheckSignQuery ¶
type IOCipher ¶
type IOCipher interface { Encrypt(w io.Writer, b []byte) (err error) Decrypt(r io.Reader) (b []byte, err error) CheckSign(w http.ResponseWriter, r *http.Request) bool CheckSignQuery(w http.ResponseWriter, r *http.Request) bool }
包装读写接口 使其能读写加解密
type MessageCrypter ¶
type MessageCrypter struct {
// contains filtered or unexported fields
}
用于微信消息的加解密 messageCrypter 封装了生成签名和消息加解密的方法
func NewmessageCrypter ¶
func NewmessageCrypter(token, encodingAESKey, appID string) (MessageCrypter, error)
NewmessageCrypter 方法用于创建 messageCrypter 实例
token 为开发者在微信开放平台上设置的 Token, encodingAESKey 为开发者在微信开放平台上设置的 EncodingAESKey, appID 为企业号的 CorpId 或者 AppId
Click to show internal directories.
Click to hide internal directories.