Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrVerification = errors.New("verification error")
Functions ¶
This section is empty.
Types ¶
type DefaultEncoder ¶
type DefaultEncoder struct { }
func (*DefaultEncoder) EncodeBytes ¶
func (encoder *DefaultEncoder) EncodeBytes(buffer *bytes.Buffer, data []byte, opts *SignOptions) ([]byte, error)
func (*DefaultEncoder) EncodeValues ¶
func (encoder *DefaultEncoder) EncodeValues(buffer *bytes.Buffer, values url.Values, opts *SignOptions) ([]byte, error)
EncodeValues 1、将参数名及其对应的值进行升序排序 2、将排序后的参数名及参数名使用等号进行连接,例如:a=10 3、将组合之后的参数使用&号进行连接,例如:a=10&b=20&c=30&c=31
type HashMethod ¶
type HashMethod struct {
// contains filtered or unexported fields
}
func NewHashMethod ¶
func NewHashMethod(h crypto.Hash) *HashMethod
type RSAMethod ¶
type RSAMethod struct {
// contains filtered or unexported fields
}
func NewRSAMethod ¶
type SignOption ¶
type SignOption func(opt *SignOptions)
func WithIgnore ¶
func WithIgnore(keys ...string) SignOption
func WithPrefix ¶
func WithPrefix(s string) SignOption
func WithSuffix ¶
func WithSuffix(s string) SignOption
type SignOptions ¶
type Signer ¶
type Signer interface { SignValues(values url.Values, opts ...SignOption) ([]byte, error) SignBytes(data []byte, opts ...SignOption) ([]byte, error) VerifyValues(values url.Values, signature []byte, opts ...SignOption) error VerifyBytes(data []byte, signature []byte, opts ...SignOption) error }
Click to show internal directories.
Click to hide internal directories.