jwt

package
v0.0.0-...-0ed9d1a Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXPIRED_DAY = time.Duration(24)
	ISSUER      = "auth.ai-ot.com" // NOTE: 変更あるかも
)

TODO: 有効期限の検討

Variables

View Source
var (
	SIGN_METHOD = jwt.SigningMethodRS256
)

Functions

func CheckToken

func CheckToken(req http.Request, keys *JWTKeys) (string, error)

func NewToken

func NewToken(keys *JWTKeys, account string, now time.Time) (string, error)

func ParseToken

func ParseToken(keys *JWTKeys, tokenString string) (*jwt.Token, error)

Types

type JWTKeys

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

func ReadKeys

func ReadKeys() (*JWTKeys, error)

Jump to

Keyboard shortcuts

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