Documentation ¶
Index ¶
- func CreateTokenRSA(key *rsa.PrivateKey, name string, b *badges.Badge) (string, error)
- func DecodeColor(clr uint32) color.RGBA
- func EncodeColor(c color.Color) uint32
- func LoadKey(filename string) (*rsa.PrivateKey, error)
- func ParseToken(token string) (*rsa.PublicKey, string, *badges.Badge, error)
- func ReadKey(r io.Reader) (*rsa.PrivateKey, error)
- type Claims
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTokenRSA ¶
CreateTokenRSA creates a JWT with the badge information, and authorizing the badge to be saved with the public key and name.
func DecodeColor ¶
DecodeColor decodes a uint32 back to a color.
func EncodeColor ¶
EncodeColor encodes a color as a uint32 for transport.
func LoadKey ¶
func LoadKey(filename string) (*rsa.PrivateKey, error)
LoadKey loads an RSA private key from a file.
func ParseToken ¶
ParseToken decodes a JWT to extract the badge and authorization.
Types ¶
type Claims ¶
type Claims struct { Name string `json:"name"` Caption string `json:"caption"` Text string `json:"text"` Color uint32 `json:"color"` Height int `json:"height,omitempty"` MinWidth int `json:"minwidth,omitempty"` rsa.PublicKey jwt.StandardClaims }
Claims are the JWT claims required to transmit and authorize the badge.
Click to show internal directories.
Click to hide internal directories.