Documentation ¶
Index ¶
- func AESDecryptData(cipherText []byte, aesKey []byte, iv []byte) (rawData []byte, err error)
- func AESDecryptMsg(base64CipherText string, encodingAESKey string) (random, rawXMLMsg, appId []byte, err error)
- func AESEncryptMsg(random, rawXMLMsg []byte, appId string, encodingAESKey string) (ciphertext string, err error)
- func GetRandString(length int) string
- func GetRandStringWithCharset(length int, charset string) string
- func TruncateRobotMsg(originalMsg, sep string) (resMsgSegments []string)
- func ValidSignature(reqTimestamp, reqNonce, reqMsgSign, token, encrypt string) (err error)
- type MsgContent
- type RecMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecryptData ¶
AESDecryptData 数据解密
func AESDecryptMsg ¶
func AESDecryptMsg(base64CipherText string, encodingAESKey string) (random, rawXMLMsg, appId []byte, err error)
AESDecryptMsg 消息解密 ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
func AESEncryptMsg ¶
func AESEncryptMsg(random, rawXMLMsg []byte, appId string, encodingAESKey string) (ciphertext string, err error)
AESEncryptMsg 消息加密 ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
func GetRandStringWithCharset ¶
GetRandStringWithCharset 获取指定字符集下 指定长度的随机字符串
func TruncateRobotMsg ¶
TruncateRobotMsg Truncate enterprise WeChat robot messages. Divide long messages by line judgment and return message slices.
func ValidSignature ¶
ValidSignature verify signature
Types ¶
type MsgContent ¶
type MsgContent struct { ToUsername string `xml:"ToUserName" json:"ToUserName"` FromUsername string `xml:"FromUserName" json:"FromUserName"` CreateTime uint32 `xml:"CreateTime" json:"CreateTime"` MsgType string `xml:"MsgType" json:"MsgType"` Event string `xml:"Event" json:"Event"` AgentID uint32 `xml:"AgentID" json:"AgentID"` ApprovalInfo struct { SpNo uint64 `xml:"SpNo" json:"SpNo"` SpName string `xml:"SpName" json:"SpName"` SpStatus uint8 `xml:"SpStatus" json:"SpStatus"` TemplateId string `xml:"TemplateId" json:"TemplateId"` ApplyTime uint32 `xml:"ApplyTime" json:"ApplyTime"` Applyer struct { UserId string `xml:"UserId" json:"UserId"` Party uint32 `xml:"Party" json:"Party"` } `xml:"Applyer" json:"Applyer"` SpRecord struct { SpStatus uint32 `xml:"SpStatus" json:"SpStatus"` ApproverAttr uint32 `xml:"ApproverAttr" json:"ApproverAttr"` Details struct { Approver struct { UserId string `xml:"UserId" json:"UserId"` } `xml:"Approver" json:"Approver"` Speech []string `xml:"Speech" json:"Speech"` SpStatus uint32 `xml:"SpStatus" json:"SpStatus"` SpTime uint32 `xml:"SpTime" json:"SpTime"` } `xml:"Details" json:"Details"` } `xml:"SpRecord" json:"SpRecord"` StatuChangeEvent uint32 `xml:"StatuChangeEvent" json:"StatuChangeEvent"` } `xml:"ApprovalInfo" json:"ApprovalInfo"` }
MsgContent 消息内容
func DecryptMsg ¶
func DecryptMsg(reqTimestamp, reqNonce, reqMsgSign, token, aesKey string, reqData []byte) (res MsgContent, err error)
DecryptMsg decrypt message
func ParseMsgContent ¶
func ParseMsgContent(reqData []byte) (res MsgContent, err error)
ParseMsgContent parse the message content
Click to show internal directories.
Click to hide internal directories.