Documentation ¶
Index ¶
- type IKey
- type IToken
- type Key
- type NewClaims
- type SignAlgorithm
- type Token
- func (tk *Token) GetClaims() *NewClaims
- func (tk *Token) GetExpiresAt() *jwt.NumericDate
- func (tk *Token) GetSignAlgorithm() SignAlgorithm
- func (tk *Token) SetClaims(claims any)
- func (tk *Token) SetExpiresAt(t int64)
- func (tk *Token) SetRepeatExpiresAt(t int64)
- func (tk *Token) SetSecret(secret string)
- func (tk *Token) SetSignAlgorithm(alg SignAlgorithm)
- func (tk *Token) SignToken() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IToken ¶
type IToken interface { SetSignAlgorithm(alg SignAlgorithm) SetExpiresAt(t int64) SetRepeatExpiresAt(t int64) SetSecret(secret string) SetClaims(claims any) SignToken() string GetExpiresAt() *jwt.NumericDate GetClaims() *NewClaims GetSignAlgorithm() SignAlgorithm }
type Key ¶
type Key struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey CommonKey string }
func (*Key) GetCommonKey ¶
func (*Key) GetPrivateKey ¶
func (k *Key) GetPrivateKey() *rsa.PrivateKey
func (*Key) GetPublicKey ¶
func (*Key) SetCommonKey ¶
func (*Key) SetPrivateKey ¶
func (*Key) SetPublicKey ¶
type SignAlgorithm ¶
type SignAlgorithm jwt.SigningMethod
var ( HMAC SignAlgorithm = jwt.SigningMethodHS256 RSA SignAlgorithm = jwt.SigningMethodRS256 )
type Token ¶
type Token struct { SignAlgorithm SignAlgorithm ExpiresAt *jwt.NumericDate Key IKey Claims *NewClaims `json:"claims"` // Payload Jwt string // Token in string }
func (*Token) GetSignAlgorithm ¶
func (tk *Token) GetSignAlgorithm() SignAlgorithm
func (*Token) SetExpiresAt ¶
func (*Token) SetRepeatExpiresAt ¶
Click to show internal directories.
Click to hide internal directories.