import "github.com/contiamo/jwt"
type Claims map[string]interface{}
Claims is a map of string->something containing the meta infos associated with a token
func CreateToken(claims Claims, key interface{}) (string, error)
CreateToken takes some claims and a key (either private rsa, private ec or hmac key) and returns a signed json web token
func GetTokenFromRequest(r *http.Request) (string, string, error)
GetTokenFromRequest takes the first Authorization header and extracts the bearer json web token
func LoadPrivateKey(keyFile string) (interface{}, error)
LoadPrivateKey loads a PEM encoded private key (either rsa or ec)
func LoadPublicKey(keyFile string) (interface{}, error)
LoadPublicKey loads a PEM encoded public key (either rsa or ec)
func ParsePrivateKey(data []byte) (interface{}, error)
ParsePrivateKey parses a pem encoded private key (rsa or ecdsa based)
func ParsePublicKey(data []byte) (interface{}, error)
ParsePublicKey parses a pem encoded public key (rsa or ecdsa based)
func GetClaimsFromRequest(r *http.Request, key interface{}) (string, Claims, error)
GetClaimsFromRequest extracts the token from a request, returning the claims
func GetClaimsFromRequestWithValidation(r *http.Request, key interface{}) (string, Claims, error)
GetClaimsFromRequestWithValidation extracts and validates the token from a request, returning the claims
func ValidateToken(tokenString string, key interface{}) (Claims, error)
ValidateToken checks the signature of the token with a given public key and returns the associated claims