Documentation ¶
Index ¶
- Constants
- func GetSignContent(params map[string]string) string
- func RsaPriKeySignature(content string, priKey *rsa.PrivateKey) (string, error)
- func RsaPrivateKeyDecode(priKey string) (*rsa.PrivateKey, error)
- func RsaPubKeySignVerify(content string, sign string, pubKey *rsa.PublicKey) error
- func RsaPublicKeyDecode(pubKey string) (*rsa.PublicKey, error)
- type Config
- type Response
- func (res *Response) GetErrorCode() int
- func (res *Response) GetErrorMessage() string
- func (res *Response) GetHttpStatus() int
- func (res *Response) GetSuccessData() map[string]interface{}
- func (res *Response) SetErrorCode(errorCode int)
- func (res *Response) SetHttpStatus(httpStatus int)
- func (res *Response) SetMessage(message string)
- func (res *Response) SetSuccessData(data map[string]interface{})
Constants ¶
View Source
const OpenApiUrl = "http://127.0.0.1:9501/openapi"
Variables ¶
This section is empty.
Functions ¶
func RsaPriKeySignature ¶
func RsaPriKeySignature(content string, priKey *rsa.PrivateKey) (string, error)
RsaPriKeySignature
@Description: 私钥生成签名 @param content:待签名字符串 @param priKey @return string @return error
func RsaPrivateKeyDecode ¶
func RsaPrivateKeyDecode(priKey string) (*rsa.PrivateKey, error)
RsaPrivateKeyDecode
@Description: 将rsa私钥解析为 *rsa.PrivateKey 类型 @param priKey @return *rsa.PrivateKey @return error
func RsaPubKeySignVerify ¶
RsaPubKeySignVerify
@Description: rsa公钥验证签名 @param content:待验证的字符串 @param sign: 待验证的签名 @param pubKey: 公钥 @return error
Types ¶
type Config ¶
type Config struct { AppId string //应用ID PriKey *rsa.PrivateKey OpenPubKey *rsa.PublicKey ApiUrl string //接口地址 }
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func (*Response) GetErrorCode ¶
func (*Response) GetErrorMessage ¶
func (*Response) GetHttpStatus ¶
func (*Response) GetSuccessData ¶
func (*Response) SetErrorCode ¶
func (*Response) SetHttpStatus ¶
func (*Response) SetMessage ¶
func (*Response) SetSuccessData ¶
Click to show internal directories.
Click to hide internal directories.