Documentation
¶
Index ¶
- func SignHMAC(secret string, options ...func(*JWTOptions)) (string, error)
- func SignRSA(privateKey *rsa.PrivateKey, options ...func(*JWTOptions)) (string, error)
- func VerifyAud(val string) func(*JWTDecoded) error
- func VerifyClaimAfter(key string, expectedTime time.Time) func(*JWTDecoded) error
- func VerifyClaimBefore(key string, expectedTime time.Time) func(*JWTDecoded) error
- func VerifyClaimEquals(key string, expected any) func(*JWTDecoded) error
- func VerifyExp(skew time.Duration) func(*JWTDecoded) error
- func VerifyHeaderEquals(key string, expected any) func(*JWTDecoded) error
- func VerifyIss(val string) func(*JWTDecoded) error
- func VerifyNbf(skew time.Duration) func(*JWTDecoded) error
- func VerifySub(val string) func(*JWTDecoded) error
- func WithAud(val string) func(*JWTOptions)
- func WithClaim(key string, val any) func(*JWTOptions)
- func WithExp(val time.Time) func(*JWTOptions)
- func WithHeader(key string, val any) func(*JWTOptions)
- func WithIat(val time.Time) func(*JWTOptions)
- func WithIss(val string) func(*JWTOptions)
- func WithJti(val string) func(*JWTOptions)
- func WithNbf(val time.Time) func(*JWTOptions)
- func WithSub(val string) func(*JWTOptions)
- type JWTClaims
- type JWTDecoded
- func (j *JWTDecoded) GetAlg() string
- func (j *JWTDecoded) GetAud() string
- func (j *JWTDecoded) GetExp() int64
- func (j *JWTDecoded) GetIat() int64
- func (j *JWTDecoded) GetIss() string
- func (j *JWTDecoded) GetJti() string
- func (j *JWTDecoded) GetNbf() int64
- func (j *JWTDecoded) GetSub() string
- func (j *JWTDecoded) GetType() string
- type JWTHeaders
- type JWTOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignRSA ¶
func SignRSA(privateKey *rsa.PrivateKey, options ...func(*JWTOptions)) (string, error)
func VerifyAud ¶
func VerifyAud(val string) func(*JWTDecoded) error
func VerifyClaimAfter ¶
func VerifyClaimAfter(key string, expectedTime time.Time) func(*JWTDecoded) error
func VerifyClaimBefore ¶
func VerifyClaimBefore(key string, expectedTime time.Time) func(*JWTDecoded) error
func VerifyClaimEquals ¶
func VerifyClaimEquals(key string, expected any) func(*JWTDecoded) error
func VerifyHeaderEquals ¶
func VerifyHeaderEquals(key string, expected any) func(*JWTDecoded) error
func VerifyIss ¶
func VerifyIss(val string) func(*JWTDecoded) error
func VerifySub ¶
func VerifySub(val string) func(*JWTDecoded) error
func WithAud ¶
func WithAud(val string) func(*JWTOptions)
func WithClaim ¶
func WithClaim(key string, val any) func(*JWTOptions)
func WithExp ¶
func WithExp(val time.Time) func(*JWTOptions)
func WithHeader ¶
func WithHeader(key string, val any) func(*JWTOptions)
func WithIat ¶
func WithIat(val time.Time) func(*JWTOptions)
func WithIss ¶
func WithIss(val string) func(*JWTOptions)
func WithJti ¶
func WithJti(val string) func(*JWTOptions)
func WithNbf ¶
func WithNbf(val time.Time) func(*JWTOptions)
func WithSub ¶
func WithSub(val string) func(*JWTOptions)
Types ¶
type JWTDecoded ¶
type JWTDecoded struct { Headers JWTHeaders Claims JWTClaims }
func VerifyHMAC ¶
func VerifyHMAC(secret, token string, validations ...func(*JWTDecoded) error) (*JWTDecoded, error)
func VerifyRSA ¶
func VerifyRSA(publicKey *rsa.PublicKey, token string, validations ...func(*JWTDecoded) error) (*JWTDecoded, error)
func (*JWTDecoded) GetAlg ¶
func (j *JWTDecoded) GetAlg() string
func (*JWTDecoded) GetAud ¶
func (j *JWTDecoded) GetAud() string
func (*JWTDecoded) GetExp ¶
func (j *JWTDecoded) GetExp() int64
func (*JWTDecoded) GetIat ¶
func (j *JWTDecoded) GetIat() int64
func (*JWTDecoded) GetIss ¶
func (j *JWTDecoded) GetIss() string
func (*JWTDecoded) GetJti ¶
func (j *JWTDecoded) GetJti() string
func (*JWTDecoded) GetNbf ¶
func (j *JWTDecoded) GetNbf() int64
func (*JWTDecoded) GetSub ¶
func (j *JWTDecoded) GetSub() string
func (*JWTDecoded) GetType ¶
func (j *JWTDecoded) GetType() string
type JWTHeaders ¶
func (JWTHeaders) GetAlg ¶
func (h JWTHeaders) GetAlg() string
func (JWTHeaders) GetType ¶
func (h JWTHeaders) GetType() string
type JWTOptions ¶
type JWTOptions struct { Headers JWTHeaders Claims JWTClaims }
Click to show internal directories.
Click to hide internal directories.