Documentation ¶
Index ¶
- Constants
- func AppendFile(fileName string, content []byte) bool
- func CheckFileExist(filePath string) bool
- func CreateDir(filePath string) bool
- func FormatPublicKey(publicKey string) string
- func Md5(s string) string
- func Md5Array(params ...string) string
- func ParsePublicKey(publicKey string) (*rsa.PublicKey, error)
- func ReadFile(filePath string) []byte
- func Rsa2PubSign(publicKey, signContent, sign string) error
- func RsaSha256(privateRaw string, msg string) (string, error)
- func WriteFile(fileName string, content []byte) bool
- type HttpResp
- func HttpGet(api string) HttpResp
- func HttpGetWithHeader(api string, h map[string]string) HttpResp
- func HttpPostForm(api string, data url.Values) HttpResp
- func HttpPostJson(api string, param interface{}) HttpResp
- func HttpPostJsonAndHeader(api string, header map[string]string, param interface{}) HttpResp
Constants ¶
View Source
const ( PKCS1 int64 = iota PKCS8 // 私钥 PEMBEGIN 开头 PEMBEGIN = "-----BEGIN RSA PRIVATE KEY-----\n" // 私钥 PEMEND 结尾 PEMEND = "\n-----END RSA PRIVATE KEY-----" // 公钥 PEMBEGIN 开头 PUBPEMBEGIN = "-----BEGIN PUBLIC KEY-----\n" // 公钥 PEMEND 结尾 PUBPEMEND = "\n-----END PUBLIC KEY-----" )
Variables ¶
This section is empty.
Functions ¶
func CheckFileExist ¶
func Rsa2PubSign ¶
Types ¶
type HttpResp ¶
func HttpPostJson ¶
Click to show internal directories.
Click to hide internal directories.