Documentation ¶
Index ¶
- Constants
- func CheckSign(charset string, source string, signMsg string, config model.MerchantConfig, ...) (err error)
- func GbkToUtf8(s []byte) ([]byte, error)
- func GenerateMd5Key(length int) string
- func GenerateMd5KeyWith32Word() string
- func GenerateSign(charset string, source string, config model.MerchantConfig, signType string) (sign string, err error)
- func ParsePrivateKey(raw string) (result []byte)
- func ParsePublicKey(raw string) (result []byte)
- func RSADecrypt(ciphertext, key []byte) ([]byte, error)
- func RSAEncrypt(plaintext, key []byte) ([]byte, error)
- func SignPKCS1v15(src, privateKey []byte, hash crypto.Hash) ([]byte, error)
- func SignPKCS1v15WithStringKey(src []byte, privateKeyString string, hash crypto.Hash) ([]byte, error)
- func SignPKCS8(src []byte, privateKey string, hash crypto.Hash) ([]byte, error)
- func Utf8ToGbk(s []byte) ([]byte, error)
- func VerifyPKCS1v15(src, sig, publicKey []byte, hash crypto.Hash) error
- func VerifyPKCS1v15WithStringKey(src, sig []byte, publicKeyString string, hash crypto.Hash) error
- type CheckSignInterface
- type CheckSignValidator
- type Md5
- type ParamsCompacter
- type RsaGenerator
- func (g *RsaGenerator) GenerateBase64KeyOfPrivateKey() (string, error)
- func (g *RsaGenerator) GenerateKeyOfPrivateKey() ([]byte, error)
- func (g *RsaGenerator) GeneratePemPrivateKey() (string, error)
- func (g *RsaGenerator) GeneratePemPrivatePKCS1Key() (string, error)
- func (g *RsaGenerator) GeneratePemPublicKey() (string, error)
- func (g *RsaGenerator) GeneratePemPublicPKIXKey() (string, error)
- type Sha256WithRSA
Constants ¶
View Source
const ( SIGN_TYPE_MD5 = "MD5" SIGN_TYPE_SHA256_WITH_RSA = "RSA" )
Variables ¶
This section is empty.
Functions ¶
func GenerateMd5Key ¶
func GenerateMd5KeyWith32Word ¶
func GenerateMd5KeyWith32Word() string
func GenerateSign ¶
func ParsePrivateKey ¶
func ParsePublicKey ¶
func RSADecrypt ¶
func RSAEncrypt ¶
Types ¶
type CheckSignInterface ¶
type CheckSignInterface interface {
// contains filtered or unexported methods
}
type CheckSignValidator ¶
type CheckSignValidator struct {
// contains filtered or unexported fields
}
func NewCheckSignValidator ¶
func NewCheckSignValidator() *CheckSignValidator
func (*CheckSignValidator) Validate ¶
func (validator *CheckSignValidator) Validate(request pay.PayRequest, cfg service.GatewayConfig) (e error)
type ParamsCompacter ¶
type ParamsCompacter struct { IgnoreKeys []string IgnoreEmptyValue bool SortedKeyFieldNames []string PairsDelimiter string KeyValueDelimiter string FieldTag string // contains filtered or unexported fields }
func NewParamsCompacter ¶
func (ParamsCompacter) BuildMapToString ¶
func (p ParamsCompacter) BuildMapToString(params map[string]string) string
func (ParamsCompacter) ParamsToString ¶
func (p ParamsCompacter) ParamsToString(instance interface{}) string
type RsaGenerator ¶
type RsaGenerator struct {
// contains filtered or unexported fields
}
func NewRsa2048Generator ¶
func NewRsa2048Generator() (*RsaGenerator, error)
func NewRsa3072Generator ¶
func NewRsa3072Generator() (*RsaGenerator, error)
func NewRsa4096Generator ¶
func NewRsa4096Generator() (*RsaGenerator, error)
func NewRsaGenerator ¶
func NewRsaGenerator(bitSize int) (*RsaGenerator, error)
func (*RsaGenerator) GenerateBase64KeyOfPrivateKey ¶
func (g *RsaGenerator) GenerateBase64KeyOfPrivateKey() (string, error)
func (*RsaGenerator) GenerateKeyOfPrivateKey ¶
func (g *RsaGenerator) GenerateKeyOfPrivateKey() ([]byte, error)
func (*RsaGenerator) GeneratePemPrivateKey ¶
func (g *RsaGenerator) GeneratePemPrivateKey() (string, error)
func (*RsaGenerator) GeneratePemPrivatePKCS1Key ¶
func (g *RsaGenerator) GeneratePemPrivatePKCS1Key() (string, error)
func (*RsaGenerator) GeneratePemPublicKey ¶
func (g *RsaGenerator) GeneratePemPublicKey() (string, error)
func (*RsaGenerator) GeneratePemPublicPKIXKey ¶
func (g *RsaGenerator) GeneratePemPublicPKIXKey() (string, error)
type Sha256WithRSA ¶
type Sha256WithRSA struct { }
Click to show internal directories.
Click to hide internal directories.