Documentation ¶
Index ¶
- func AesECBDecrypt(ciphertext, key []byte) (plaintext []byte, err error)
- func CBCDecrypt(ssk, data, iv string) (bts []byte, err error)
- func CBCEncrypt(key, data string) (ciphertext []byte, err error)
- func FetchIP() (net.IP, error)
- func GetQuery(req *http.Request, key string) string
- func MD5(str string) (string, error)
- func NewTLSClient(certPath, keyPath string) (httpClient *http.Client, err error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(plaintext []byte) ([]byte, error)
- func PostXML(uri string, obj interface{}) ([]byte, error)
- func RandomString(ln int) string
- func SignByMD5(data map[string]string, key string) (string, error)
- func TSLPostXML(uri string, obj interface{}, certPath, keyPath string) ([]byte, error)
- func TokenAPI(api, token string) (string, error)
- func Validate(rawData, ssk, signature string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CBCDecrypt ¶
CBCDecrypt CBC解密数据
@ssk 通过 Login 向微信服务端请求得到的 session_key @data 小程序通过 api 得到的加密数据(encryptedData) @iv 小程序通过 api 得到的初始向量(iv)
func CBCEncrypt ¶
CBCEncrypt CBC加密数据
func NewTLSClient ¶
NewTLSClient 创建支持双向证书认证的 http.Client.
func PKCS5Padding ¶
PKCS5Padding 补位 Golang AES没有64位的块, 如果采用PKCS5, 那么实质上就是采用PKCS7
func PKCS5UnPadding ¶
PKCS5UnPadding 反补 Golang AES没有64位的块, 如果采用PKCS5, 那么实质上就是采用PKCS7
func TSLPostXML ¶
TSLPostXML ...
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.