jwt

package
v0.0.0-...-e7df039 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Headers

type Headers struct {
	Typ interface{} // 声明类型
	Alg interface{} // 声明加密算法
}

type M

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

func New

func New() *M

func (*M) Parse

func (m *M) Parse(c string) (*Headers, *Payload, error)

func (*M) Produce

func (m *M) Produce() (interface{}, error)

func (*M) Refresh

func (m *M) Refresh(c string) (interface{}, error)

func (*M) SetHeadersAlg

func (m *M) SetHeadersAlg(alg interface{}) *M

func (*M) SetHeadersTyp

func (m *M) SetHeadersTyp(typ interface{}) *M

func (*M) SetPayloadAud

func (m *M) SetPayloadAud(aud interface{}) *M

func (*M) SetPayloadExp

func (m *M) SetPayloadExp(exp time.Duration) *M

func (*M) SetPayloadIat

func (m *M) SetPayloadIat(iat time.Time) *M

func (*M) SetPayloadInf

func (m *M) SetPayloadInf(inf interface{}) *M

func (*M) SetPayloadIss

func (m *M) SetPayloadIss(iss interface{}) *M

func (*M) SetPayloadJti

func (m *M) SetPayloadJti(jti interface{}) *M

func (*M) SetPayloadNbf

func (m *M) SetPayloadNbf(nbf time.Time) *M

func (*M) SetPayloadSub

func (m *M) SetPayloadSub(sub interface{}) *M

func (*M) SetSignature

func (m *M) SetSignature(sign string) *M

type Payload

type Payload struct {
	Iss interface{}   // 签发者
	Sub interface{}   // 主题
	Aud interface{}   // 接受者
	Iat time.Time     // 生成签名时间
	Nbf time.Time     // 生效时间(定义在什么时间之前, JWT不可用, 需要晚于签发时间)
	Jti interface{}   // 编号(唯一身份标识, 识别一次行token, 避免重复攻击)
	Inf interface{}   // 自定义内容
	Exp time.Duration // 多少时间过期(时,分,秒)
}

Jump to

Keyboard shortcuts

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