jwt

package
v0.0.0-...-8110901 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RsaKey

type RsaKey struct {
	PublicKey *rsa.PublicKey
	// contains filtered or unexported fields
}

RsaKey is the instantiated key to generate JWT tokens with. Important method is GenerateJWT

func NewRsaKey

func NewRsaKey() *RsaKey

NewRsaKey generates a new RSA key based on a 2048 byte length

func (*RsaKey) GenerateJWT

func (r *RsaKey) GenerateJWT(u *types.User) []byte

GenerateJWT uses the RSAKey and user input to generate a JWT token. It returns the token in []byte form

func (*RsaKey) PrintPublicPem

func (r *RsaKey) PrintPublicPem() []byte

PrintPublicPem returns the public key as []byte in pem format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL