jwt

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jwt

type Jwt struct {
	PrivateKey *rsa.PrivateKey
	PublicKey  *rsa.PublicKey
	Options    *Options
}

func NewRSA added in v1.2.5

func NewRSA(o *Options) (*Jwt, error)

func (*Jwt) AccessToken

func (jwt *Jwt) AccessToken(uid uint64, iss string) (*string, error)

func (*Jwt) RefreshToken

func (jwt *Jwt) RefreshToken(uid uint64, iss string) (*string, *string, error)

func (*Jwt) Validate

func (jwt *Jwt) Validate(t string) (*TokenClaims, error)

type Options added in v1.2.5

type Options struct {
	PrivateKeyPath       string
	PublicKeyPath        string
	AccessTokenLifetime  int
	RefreshTokenLifetime int
}

type TokenClaims

type TokenClaims struct {
	UID  uint64
	Type string
	Key  *string
	j.RegisteredClaims
}

Jump to

Keyboard shortcuts

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