Documentation ¶
Index ¶
- func AesCBCEncrypt(rawData []byte, key []byte) ([]byte, []byte, error)
- func AesCbcDecrypt(enData []byte, key []byte, iv []byte) ([]byte, error)
- func Decrypt(secret string, data string, v interface{}) (err error)
- func DecryptString(secret string, data string) (string, error)
- func Encrypt(secret string, data interface{}) (string, error)
- func EncryptString(secret string, data string) (string, error)
- func HashSha256(src string) string
- func Md5(str string) string
- func NullUnPadding(in []byte) []byte
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(data []byte) []byte
- func PasswordHash(password string) (string, error)
- func PasswordVerify(password, hash string) bool
- type ApiDataEncrypter
- func (ae *ApiDataEncrypter) BuildEnParams(params url.Values, data map[string]interface{}) (url.Values, error)
- func (ae *ApiDataEncrypter) Decrypt(data string, v interface{}, debug ...bool) error
- func (ae *ApiDataEncrypter) DecryptRaw(data string, v interface{}) error
- func (ae *ApiDataEncrypter) DecryptString(data string) (string, error)
- func (ae *ApiDataEncrypter) Encrypt(data interface{}) (string, error)
- func (ae *ApiDataEncrypter) EncryptString(data string) (string, error)
- func (ae *ApiDataEncrypter) Request(method string, remoteUrl string, data map[string]interface{}, ...) (*http.Response, error)
- func (ae *ApiDataEncrypter) RequestJson(v interface{}, method string, remoteUrl string, data map[string]interface{}, ...) error
- func (ae *ApiDataEncrypter) RequestJsonDecryptData(v interface{}, method string, remoteUrl string, data map[string]interface{}, ...) (err error)
- func (ae *ApiDataEncrypter) RequestJsonDecryptString(method string, remoteUrl string, data map[string]interface{}, ...) (resStr string, err error)
- func (ae *ApiDataEncrypter) SetTimeout(timeout time.Duration) *ApiDataEncrypter
- func (ae *ApiDataEncrypter) SignRequest(method string, remoteUrl string, params url.Values, headers map[string]string, ...) (resp *http.Response, err error)
- func (ae *ApiDataEncrypter) SignRequestJson(v interface{}, method string, remoteUrl string, params url.Values, ...) error
- type ApiReturnJson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesCBCEncrypt ¶
aes加密,填充秘钥key的16位,24,32分别对应AES-128, AES-192, or AES-256.
func HashSha256 ¶
func NullUnPadding ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func PasswordHash ¶
func PasswordVerify ¶
Types ¶
type ApiDataEncrypter ¶
type ApiDataEncrypter struct { Key string AppId string Timeout time.Duration SslVerify bool SslClientCertPemPath string SslClientCertPemContent []byte SslClientCertPemKey []byte // contains filtered or unexported fields }
func (*ApiDataEncrypter) BuildEnParams ¶
func (*ApiDataEncrypter) Decrypt ¶
func (ae *ApiDataEncrypter) Decrypt(data string, v interface{}, debug ...bool) error
func (*ApiDataEncrypter) DecryptRaw ¶
func (ae *ApiDataEncrypter) DecryptRaw(data string, v interface{}) error
func (*ApiDataEncrypter) DecryptString ¶
func (ae *ApiDataEncrypter) DecryptString(data string) (string, error)
func (*ApiDataEncrypter) Encrypt ¶
func (ae *ApiDataEncrypter) Encrypt(data interface{}) (string, error)
func (*ApiDataEncrypter) EncryptString ¶
func (ae *ApiDataEncrypter) EncryptString(data string) (string, error)
func (*ApiDataEncrypter) RequestJson ¶
func (*ApiDataEncrypter) RequestJsonDecryptData ¶
func (*ApiDataEncrypter) RequestJsonDecryptString ¶
func (*ApiDataEncrypter) SetTimeout ¶
func (ae *ApiDataEncrypter) SetTimeout(timeout time.Duration) *ApiDataEncrypter
func (*ApiDataEncrypter) SignRequest ¶
Click to show internal directories.
Click to hide internal directories.