xjwt

package
v0.0.0-...-9493ce7 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrJWTFormat = errors.New("jwt format error")
	ErrJWTSign   = errors.New("jwt sign error")
)

Functions

func JWTToRaw

func JWTToRaw(in string) (out string)

JWTToRaw 转换为原始类型

func JWTToURLSafe

func JWTToURLSafe(in string) (out string)

JWTToURLSafe 转换为URL安全

func NewJWTHmac

func NewJWTHmac(secret string) hash.Hash

NewJWTHmac 实例化HMAC

Types

type JWT

type JWT struct {
	Header  interface{}
	Payload interface{}
	Secret  string
	// contains filtered or unexported fields
}

JWT

func NewJWT

func NewJWT(header, payload interface{},
	secret string) *JWT

NewJWT 工厂方法

func ToJWT

func ToJWT(jwtStr, secret string) (jwt *JWT, err error)

转换为JWT

func (*JWT) String

func (object *JWT) String() (str string)

String 字符串

func (*JWT) Verify

func (object *JWT) Verify(str string) (err error)

Verify 校验

Jump to

Keyboard shortcuts

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