km

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebTokenField_UserId    = "userId"
	WebTokenField_SessionId = "sessionId"
	TokenHeader_Alg         = "alg"
	TokenAlg_PS512          = "PS512" // RSA-PSS.
	TokenAlg_RS512          = "RS512" // RSA.
)
View Source
const (
	ErrSigningMethodIsNotSupported = "signing method is not supported"
	ErrTokenIsNotValid             = "token is not valid"
	ErrTokenIsBroken               = "token is broken"
	ErrFUnsupportedSigningMethod   = "unsupported signing method: %s"
	ErrFUnexpectedSigningMethod    = "unexpected signing method: %v"
	ErrTypeCast                    = "type cast error"
)
View Source
const (
	ErrRsaPssGoLanguageWhatAShame = "this stupid Go language does not support parsing RSA-PSS keys, what a shame"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMaker

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

func New

func New(signingMethodName string, privateKeyFilePath string, publicKeyFilePath string) (km *KeyMaker, err error)

func (*KeyMaker) MakeJWToken

func (km *KeyMaker) MakeJWToken(userId uint, sessionId uint) (tokenString string, err error)

func (*KeyMaker) ValidateToken

func (km *KeyMaker) ValidateToken(tokenString string) (userId uint, sessionId uint, err error)

Jump to

Keyboard shortcuts

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