Documentation ¶
Index ¶
- Variables
- func Marshal(rand io.Reader, payload interface{}, signer Signer) ([]byte, error)
- func MarshalWithHeader(rand io.Reader, payload interface{}, header Header, signer Signer) ([]byte, error)
- func RegisterAlgorithm(a Algorithm, alg jwa.Algoritm)
- func RegisterKeyType(k KeyType, p KeyParser)
- func Unmarshal(b []byte, payload interface{}, verifiers Verifiers) (string, error)
- func UnmarshalPayload(b []byte, payload interface{}) error
- func UnmarshalWithHeader(b []byte, payload interface{}, header Header, verifiers Verifiers) (string, error)
- type Algorithm
- type Header
- type KeyParser
- type KeyType
- type Signer
- type Verifier
- type Verifiers
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMalformedToken = errors.New("malformed packet") ErrMalformedHeader = errors.New("malformed header") ErrInvalidSignature = errors.New("signature is invalid") ErrNoVerifiersWithKID = errors.New("no verifiers with kid") )
View Source
var ( // ErrInvalidHeaderType is returned when the type of the header is wrong ErrInvalidHeaderType = errors.New("invalid header type") )
Functions ¶
func MarshalWithHeader ¶
func RegisterAlgorithm ¶
func RegisterKeyType ¶
func UnmarshalPayload ¶
Types ¶
type Algorithm ¶
type Algorithm uint8
Algorithm is the different JWT algoritms
func GetAlgorithm ¶
func (Algorithm) NewVerifier ¶
func (Algorithm) SignatureSize ¶
type Header ¶
type Header interface { Valid() error Alg() Algorithm Kid() string SetAlg(a Algorithm) SetKid(s string) }
Header is the interface for minimum header
Click to show internal directories.
Click to hide internal directories.