Documentation ¶
Overview ¶
Utility for sign the param and validate sign & data
Index ¶
- func Sign(param map[string]interface{}, signType string, ...) (sign string, err error)
- func ValidateSign(payload interface{}, loadPublicKey LoadPublicKeyFunc) (ok bool, err error)
- func ValidateSignSync(data, sign string, loadPublicKey LoadPublicKeyFunc) (ok bool, err error)
- type LoadPrivateKeyFunc
- type LoadPublicKeyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sign ¶
func Sign(param map[string]interface{}, signType string, loadPrivateFunc LoadPrivateKeyFunc) (sign string, err error)
Sign params
func ValidateSign ¶
func ValidateSign(payload interface{}, loadPublicKey LoadPublicKeyFunc) (ok bool, err error)
Validate Notify Sign
func ValidateSignSync ¶
func ValidateSignSync(data, sign string, loadPublicKey LoadPublicKeyFunc) (ok bool, err error)
Validate Response Sign
Types ¶
type LoadPrivateKeyFunc ¶
type LoadPrivateKeyFunc func() (publicKey *rsa.PrivateKey, err error)
type LoadPublicKeyFunc ¶
Click to show internal directories.
Click to hide internal directories.