Versions in this module Expand all Collapse all v1 v1.0.1 Mar 19, 2024 Changes in this version + var ErrVerification = errors.New("verification error") + type DefaultEncoder struct + func (encoder *DefaultEncoder) EncodeBytes(buffer *bytes.Buffer, data []byte, opts *SignOptions) ([]byte, error) + func (encoder *DefaultEncoder) EncodeValues(buffer *bytes.Buffer, values url.Values, opts *SignOptions) ([]byte, error) + type Encoder interface + EncodeBytes func(buffer *bytes.Buffer, data []byte, opts *SignOptions) ([]byte, error) + EncodeValues func(buffer *bytes.Buffer, values url.Values, opts *SignOptions) ([]byte, error) + type HashMethod struct + func NewHashMethod(h crypto.Hash) *HashMethod + func (method *HashMethod) Sign(data []byte) ([]byte, error) + func (method *HashMethod) Verify(data []byte, signature []byte) error + type Method interface + Sign func(data []byte) ([]byte, error) + Verify func(data []byte, signature []byte) error + type Option func(signer *signer) + func WithEncoder(encoder Encoder) Option + func WithMethod(method Method) Option + type RSAMethod struct + func NewRSAMethod(h crypto.Hash, privateKey *rsa.PrivateKey, publicKey *rsa.PublicKey) *RSAMethod + func (method *RSAMethod) Sign(data []byte) ([]byte, error) + func (method *RSAMethod) Verify(data []byte, signature []byte) error + type SignOption func(opt *SignOptions) + func WithIgnore(keys ...string) SignOption + func WithPrefix(s string) SignOption + func WithSuffix(s string) SignOption + type SignOptions struct + Ignores map[string]struct{} + Prefix string + Suffix string + type Signer interface + SignBytes func(data []byte, opts ...SignOption) ([]byte, error) + SignValues func(values url.Values, opts ...SignOption) ([]byte, error) + VerifyBytes func(data []byte, signature []byte, opts ...SignOption) error + VerifyValues func(values url.Values, signature []byte, opts ...SignOption) error + func New(opts ...Option) Signer