Documentation ¶
Index ¶
- func Signature(token, timestamp, nonce, enc string) string
- type AES
- type Crypto
- func (c *Crypto) Decrypt(in []byte) (out []byte, err error)
- func (c *Crypto) DecryptMessage(enc []byte) ([]byte, error)
- func (c *Crypto) Encrypt(in []byte) (out []byte, err error)
- func (c *Crypto) EncryptMessage(dec []byte) (enc []byte, err error)
- func (c *Crypto) GetAESKey() (key []byte, err error)
- func (c *Crypto) GetDecrypter() (cipher.BlockMode, error)
- func (c *Crypto) GetEncrypter() (cipher.BlockMode, error)
- func (c *Crypto) Reset()
- func (c *Crypto) Signature(timestamp, nonce, enc string) string
- func (c *Crypto) Verify(signature, timestamp, nonce, echo string) ([]byte, error)
- type ReceiveContent
- type ReceiveMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AES ¶
type AES struct { Duplicate bool // contains filtered or unexported fields }
AES Helper
func NewAESFromEncodeKey ¶
NewAESFromEncodeKey create from base64 encode key
func NewAESFromKey ¶
NewAESFromKey create from raw key
type Crypto ¶
type ReceiveContent ¶
func DecryptContent ¶
func DecryptContent(encodingAESKey string, enc []byte) (msg *ReceiveContent, err error)
func (*ReceiveContent) MarshalBinary ¶
func (rc *ReceiveContent) MarshalBinary() (data []byte, err error)
func (*ReceiveContent) UnmarshalBinary ¶
func (rc *ReceiveContent) UnmarshalBinary(data []byte) (err error)
func (*ReceiveContent) VerifyReceiverID ¶
func (rc *ReceiveContent) VerifyReceiverID(r string) bool
type ReceiveMessage ¶
type ReceiveMessage struct { ToUsername string `xml:"ToUserName"` Encrypt string `xml:"Encrypt"` AgentID string `xml:"AgentID"` Content *ReceiveContent `xml:"-"` }
func DecryptMessage ¶
func DecryptMessage(encodingAESKey string, post []byte) (msg *ReceiveMessage, err error)
Click to show internal directories.
Click to hide internal directories.