Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeys ¶
GenerateKeys generate and save the keys to disk
Types ¶
type Claims ¶
type Claims struct { // Subject or userid Sub string `json:"sub,omitempty"` // When the token will expire Exp int `json:"exp,omitempty"` // Token is not valid before this time Nbf int `json:"nbf,omitempty"` // When the token was issued Iat int `json:"iat,omitempty"` }
Claims struct to hold various public data
func NewClaimsParse ¶
NewClaimsParse creates a new claims from a string the message should be a base64.URLEncoded string
func (*Claims) EncodedBytes ¶
EncodedBytes takes the bytes tring and url encodes it
type Header ¶
Header struct to hold the header information
func NewHeaderParse ¶
NewHeaderParse function to create new JWT header message should be the base64.URLEncoded string
func (*Header) EncodedBytes ¶
EncodedBytes takes the bytes string and url encodes it
type JWT ¶
JWT struct holds the entire token
func NewJWTParse ¶
NewJWTParse takes a jwt token string and parse it into a token message should be the unmodified base64.RawURLEncoded string
func (*JWT) EncodedBytesSignature ¶
EncodedBytesSignature returns the encoded byte string
func (*JWT) GenerateMessage ¶
GenerateMessage returns the full jwt token
func (*JWT) GenerateToken ¶
GenerateToken takes all the components and spits out a token
func (*JWT) ValidateToken ¶
ValidateToken checks the token claims at UTC time
func (*JWT) VerifyToken ¶
VerifyToken checks the signature is valid