Documentation ¶
Index ¶
- func AesDecrypt(src, key, iv []byte, mode string) ([]byte, error)
- func AesEncrypt(src, key, iv []byte, mode string) ([]byte, error)
- func DoReq(method, URL string, data *map[string]interface{}, ...) (*et.Result, error)
- func Eapi(URL string, obj interface{}) (url.Values, error)
- func GenerateKey(size int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func GenerateKey64(size int) (pri64, pub64 string, err error)
- func GenerateKeyBytes(size int) (privateBytes, publicBytes []byte, err error)
- func GetWithHeaders(url string, data url.Values, headers url.Values) (resp *http.Response, err error)
- func LinuxApi(obj interface{}) (url.Values, error)
- func Md5String(pass string) string
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCS7Padding(ciphertext []byte) []byte
- func PKCS7UnPadding(plantText []byte) []byte
- func PostFormWithHeaders(url string, data url.Values, headers url.Values) (resp *http.Response, err error)
- func PrivateDecrypt(key *rsa.PrivateKey, data []byte) ([]byte, error)
- func PrivateKeyFrom(key []byte) (*rsa.PrivateKey, error)
- func PrivateKeyFrom64(key string) (*rsa.PrivateKey, error)
- func PrivateSign(key *rsa.PrivateKey, data []byte) ([]byte, error)
- func PrivateVerify(key *rsa.PrivateKey, sign, data []byte) error
- func PublicEncrypt(key *rsa.PublicKey, data []byte) ([]byte, error)
- func PublicEncryptNoPadding(pub *rsa.PublicKey, data []byte) ([]byte, error)
- func PublicKeyFrom(key []byte) (*rsa.PublicKey, error)
- func PublicKeyFrom64(key string) (*rsa.PublicKey, error)
- func PublicSign(key *rsa.PublicKey, data []byte) ([]byte, error)
- func PublicVerify(key *rsa.PublicKey, sign, data []byte) error
- func ReadSetCookies(h http.Header) []*http.Cookie
- func ReplaceAllWithReg(reg string, src []string, repl string) []string
- func ReplaceWithReg(reg, src, repl string) string
- func RsaEncrypt(src, key []byte) ([]byte, error)
- func ToBase64(src []byte) []byte
- func ToBase64String(src []byte) string
- func Weapi(obj interface{}) (url.Values, error)
- type RequestOptions
- func (opt *RequestOptions) Cookie(cookie interface{}) *RequestOptions
- func (opt *RequestOptions) CookieString(cookie string) *RequestOptions
- func (opt *RequestOptions) CryptoEapi() *RequestOptions
- func (opt *RequestOptions) CryptoLinux() *RequestOptions
- func (opt *RequestOptions) Raw() *map[string]interface{}
- func (opt *RequestOptions) RealIP(ip string) *RequestOptions
- func (opt *RequestOptions) SetOption(key string, value interface{})
- func (opt *RequestOptions) UA(ua string) *RequestOptions
- func (opt *RequestOptions) URL(url string) *RequestOptions
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKey ¶
func GenerateKey64 ¶
GenerateKey64 uses key sizes of 1024, 2048 or 4096
func GenerateKeyBytes ¶
func GetWithHeaders ¶
func PKCS7Padding ¶
func PKCS7UnPadding ¶
func PostFormWithHeaders ¶
func PrivateDecrypt ¶
func PrivateDecrypt(key *rsa.PrivateKey, data []byte) ([]byte, error)
func PrivateKeyFrom ¶
func PrivateKeyFrom(key []byte) (*rsa.PrivateKey, error)
func PrivateKeyFrom64 ¶
func PrivateKeyFrom64(key string) (*rsa.PrivateKey, error)
func PrivateSign ¶
func PrivateSign(key *rsa.PrivateKey, data []byte) ([]byte, error)
func PrivateVerify ¶
func PrivateVerify(key *rsa.PrivateKey, sign, data []byte) error
func PublicEncryptNoPadding ¶
func ReplaceWithReg ¶
func RsaEncrypt ¶
func encrypt_RSA(pub *rsa.PublicKey, data []byte) []byte { encrypted := new(big.Int) e := big.NewInt(int64(pub.E)) payload := new(big.Int).SetBytes(data) encrypted.Exp(payload, e, pub.N) return encrypted.Bytes() }
func ToBase64String ¶
Types ¶
type RequestOptions ¶
type RequestOptions map[string]interface{}
func DefaultEmptyRequestOpts ¶
func DefaultEmptyRequestOpts() *RequestOptions
func DefaultRequestOpts ¶
func DefaultRequestOpts() *RequestOptions
func (*RequestOptions) Cookie ¶
func (opt *RequestOptions) Cookie(cookie interface{}) *RequestOptions
func (*RequestOptions) CookieString ¶
func (opt *RequestOptions) CookieString(cookie string) *RequestOptions
func (*RequestOptions) CryptoEapi ¶
func (opt *RequestOptions) CryptoEapi() *RequestOptions
func (*RequestOptions) CryptoLinux ¶
func (opt *RequestOptions) CryptoLinux() *RequestOptions
func (*RequestOptions) Raw ¶
func (opt *RequestOptions) Raw() *map[string]interface{}
func (*RequestOptions) RealIP ¶
func (opt *RequestOptions) RealIP(ip string) *RequestOptions
func (*RequestOptions) SetOption ¶
func (opt *RequestOptions) SetOption(key string, value interface{})
safe to use in multiple goroutines
func (*RequestOptions) UA ¶
func (opt *RequestOptions) UA(ua string) *RequestOptions
func (*RequestOptions) URL ¶
func (opt *RequestOptions) URL(url string) *RequestOptions
Click to show internal directories.
Click to hide internal directories.