Documentation
¶
Index ¶
- Variables
- func SignObject(ctx context.Context, signer Signer, obj interface{}) (string, error)
- func SignObjectEncoder(ctx context.Context, signer Signer, obj interface{}, ...) (string, error)
- func UnsignObject(ctx context.Context, signer Signer, signed string, obj interface{}) error
- func UnsignObjectDecoder(ctx context.Context, signer Signer, signed string, obj interface{}, ...) error
- type BaseSigner
- func (s *BaseSigner) Algorithm() algorithm.Algorithm
- func (s *BaseSigner) FallbackKeys() [][]byte
- func (s *BaseSigner) Key() []byte
- func (s *BaseSigner) Salt() []byte
- func (s *BaseSigner) Separator() string
- func (s *BaseSigner) Sign(ctx context.Context, data []byte) (string, error)
- func (s *BaseSigner) Signature(ctx context.Context, data []byte) ([]byte, error)
- func (s *BaseSigner) Unsign(ctx context.Context, signedData string) ([]byte, error)
- type Decoder
- type Encoder
- type Signer
- type TimestampSigner
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSigning = algorithm.ErrSigning ErrBadSignature = algorithm.ErrBadSignature ErrSignatureMismatch = algorithm.ErrSignatureMismatch ErrSignatureExpired = algorithm.ErrSignatureExpired ErrUnknownSignatureAlgorithm = algorithm.ErrUnknownSignatureAlgorithm )
View Source
var ( DefaultEncoder = JSONEncoder DefaultDecoder = JSONDecoder )
Functions ¶
func SignObject ¶
func SignObjectEncoder ¶
func UnsignObject ¶
Types ¶
type BaseSigner ¶
type BaseSigner struct {
// contains filtered or unexported fields
}
func NewBaseSigner ¶
func (*BaseSigner) Algorithm ¶
func (s *BaseSigner) Algorithm() algorithm.Algorithm
func (*BaseSigner) FallbackKeys ¶
func (s *BaseSigner) FallbackKeys() [][]byte
func (*BaseSigner) Key ¶
func (s *BaseSigner) Key() []byte
func (*BaseSigner) Salt ¶
func (s *BaseSigner) Salt() []byte
func (*BaseSigner) Separator ¶
func (s *BaseSigner) Separator() string
type Decoder ¶
func JSONDecoder ¶
type Encoder ¶
func JSONEncoder ¶
Click to show internal directories.
Click to hide internal directories.