common

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptWithGCM

func AESDecryptWithGCM(data string, key string, nonceStr string, additionalData string) string

AESDecryptWithGCM AES-256-GCM

func DecryptOAEP

func DecryptOAEP(ciphertext string, pemPath string) string

DecryptOAEP 解密

func EncryptOAEP

func EncryptOAEP(text string, pemPath string) string

EncryptOAEP 加密

func Get

func Get(url string) (body []byte, err error)

Get http get

func IsBlank

func IsBlank(str string) bool

IsBlank 判断字符串是否为空

func IsNotBlank

func IsNotBlank(str string) bool

IsNotBlank 判断字符串是否为空

func ParsePKCS1PrivateKey

func ParsePKCS1PrivateKey(pemPath string) (privateKey *rsa.PrivateKey, err error)

ParsePKCS1PrivateKey 解析私钥

func ParsePKIXPublicKey

func ParsePKIXPublicKey(pemPath string) (publicKey *rsa.PublicKey, err error)

ParsePKIXPublicKey 获取RSA公钥

func Post

func Post(url, contentType string, data []byte) ([]byte, error)

Post http post

func PostWithAuthorizationSerial

func PostWithAuthorizationSerial(url string, data []byte, authorization string, serial string) ([]byte, error)

PostWithAuthorizationSerial POST 认证信息 证书编号

func PostWithJSON

func PostWithJSON(url string, data []byte) ([]byte, error)

PostWithJSON http post

func SHA256withRSA

func SHA256withRSA(data string, pem string) (string, error)

SHA256withRSA SHA256withRSA

Types

type Error

type Error struct {
	ErrCode int64  `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

Error 微信返回的通用错误json

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL