Versions in this module Expand all Collapse all v0 v0.2.0 Mar 11, 2018 Changes in this version + type JSONToken struct + Audience string + Expiration time.Time + IssuedAt time.Time + Issuer string + Jti string + NotBefore time.Time + Subject string + func (t *JSONToken) Get(key string) string + func (t *JSONToken) Set(key string, value string) + func (t *JSONToken) UnmarshalJSON(data []byte) error + func (t *JSONToken) Validate(validators ...Validator) error + func (t JSONToken) MarshalJSON() ([]byte, error) + type Validator func(token *JSONToken) error + func ForAudience(audience string) Validator + func IdentifiedBy(jti string) Validator + func IssuedBy(issuer string) Validator + func Subject(subject string) Validator + func ValidAt(t time.Time) Validator v0.1.0 Feb 21, 2018 Changes in this version + const V1 + const V2 + var ErrDataUnmarshal = errors.New("can't unmarshal token data to the given type of value") + var ErrIncorrectPrivateKeyType = errors.New("incorrect private key type") + var ErrIncorrectPublicKeyType = errors.New("incorrect public key type") + var ErrIncorrectTokenFormat = errors.New("incorrect token format") + var ErrIncorrectTokenHeader = errors.New("incorrect token header") + var ErrInvalidSignature = errors.New("invalid signature") + var ErrInvalidTokenAuth = errors.New("invalid token authentication") + var ErrPublicKeyNotFound = errors.New("public key for this version not found") + var ErrUnsupportedTokenType = errors.New("unsupported token type") + var ErrUnsupportedTokenVersion = errors.New("unsupported parser version") + func GetTokenInfo(token string) (Version, Purpose, error) + func ParseFooter(token string, footer interface{}) error + func WithFooter(footer interface{}) func(*options) + type Protocol interface + Decrypt func(token string, key []byte, payload interface{}, footer interface{}) error + Encrypt func(key []byte, payload interface{}, options ...opsFunc) (string, error) + Sign func(privateKey crypto.PrivateKey, payload interface{}, options ...opsFunc) (string, error) + Verify func(token string, publicKey crypto.PublicKey, value interface{}, ...) error + func NewV1() Protocol + func NewV2() Protocol + type Purpose int + const LOCAL + const PUBLIC + type Version string + func Parse(token string, payload interface{}, footer interface{}, symmetricKey []byte, ...) (Version, error)