jwt_helper

package
v0.0.0-...-a4c8aa7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorInvalidToken  = "invalid token"
	ErrorInvalidClaims = "invalid claims"
	ErrorEmailClaim    = "email claim is missing or invalid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

type JWT struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
}

func NewJWT

func NewJWT(privateKeyFile, publicKeyFile string) *JWT

func (*JWT) Create

func (j *JWT) Create(data JWTData) (string, error)

Создание JWT-токена

func (*JWT) Parse

func (j *JWT) Parse(tokenString string) (*JWTData, error)

type JWTData

type JWTData struct {
	Email string
}

Jump to

Keyboard shortcuts

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