Versions in this module Expand all Collapse all v1 v1.0.0 Jun 19, 2021 Changes in this version + var ErrBadHashFunc = errors.New("hash function for key is not available") + var ErrBadType = errors.New("bad token type") + var ErrCreatedAfterNow = errors.New("token created after now") + var ErrEmptySignKey = errors.New("empty token sign key") + var ErrExpired = errors.New("token expired") + var ErrInvalid = errors.New("invalid token") + var ErrNotBeforeNow = errors.New("token not before now") + var ErrNotSigned = errors.New("token not signed") + var RSAKeyBits = 2048 + func Decode(token string, claimset interface{}) error + func Encode(claimset, key interface{}) (string, error) + func NewES256Key() *ecdsa.PrivateKey + func NewHS256Key(length int) []byte + func NewRS256Key() *rsa.PrivateKey + func Nonce(length uint8) func() string + func Verify(token string, key interface{}) (claim []byte, err error) + type Config struct + Created bool + Expires time.Duration + Issuer string + Key interface{} + NotBefore time.Duration + Private JSON + Type string + UniqueID func() string + func (c Config) Token(claimset interface{}) (string, error) + type JSON = map[string]interface + type JWK struct + Algorithm string + Curve string + D string + DP string + DQ string + E string + ID string + K string + KeyOps []string + N string + OTH []rsaCtr + P string + Q string + QI string + Type string + Usage string + X string + Y string + func JWKEncode(key interface{}, keyID string) (jwk *JWK, err error) + func (key *JWK) Decode() (interface{}, error) + type Time struct + func (t *Time) UnmarshalJSON(data []byte) error + func (t Time) MarshalJSON() ([]byte, error)