jwt

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeKeyPair

func MakeKeyPair(bits int) (*model.KeyPair, error)

Types

type JWT

type JWT struct {
	SigningMethod jwt.SigningMethodRSA
	// contains filtered or unexported fields
}

func New

func New(privateKey []byte, signingMethod jwt.SigningMethodRSA) *JWT

func (*JWT) GenerateToken

func (j *JWT) GenerateToken(payload *model.Payload) (string, error)

func (*JWT) GetToken

func (j *JWT) GetToken(payload string, expiryTime time.Duration) (string, error)

type JWTValidator

type JWTValidator struct {
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(publicKey []byte) *JWTValidator

func (*JWTValidator) ValidateToken

func (j *JWTValidator) ValidateToken(tokenString string) (*model.Payload, error)

Jump to

Keyboard shortcuts

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