Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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
func (MessageCrypter) Decrypt ¶
func (w MessageCrypter) Decrypt(text string) ([]byte, string, error)
Decrypt 方法用于对密文进行解密
返回解密后的消息,CropId/AppId, 或者错误信息
func (MessageCrypter) Encrypt ¶
func (w MessageCrypter) Encrypt(text string) (string, error)
Encrypt 方法用于对明文进行加密
func (MessageCrypter) GetSignature ¶
func (w MessageCrypter) GetSignature(timestamp, nonce, msgEncrypt string) string
GetSignature 方法用于返回签名
Click to show internal directories.
Click to hide internal directories.