tokenx

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MulanPSL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPriKey

func GetPriKey(file string) (*rsa.PrivateKey, error)

func GetPubKey

func GetPubKey(file string) (*rsa.PublicKey, error)

func New

func New(method jwt.SigningMethod) *jwt.Token

func NewWithClaims

func NewWithClaims(method jwt.SigningMethod, claims jwt.Claims) *jwt.Token

func Parse

func Parse(tokenString string, keyFunc jwt.Keyfunc) (*jwt.Token, error)

func ParseString

func ParseString(pubFile string, signStr string) (interface{}, error)

func ParseWithClaims

func ParseWithClaims(tokenString string, claims jwt.Claims, keyFunc jwt.Keyfunc) (*jwt.Token, error)

func RSADecrypt added in v1.0.14

func RSADecrypt(pubFile, signingString, signature string) error

RSADecrypt 校验

func RSAEncrypt added in v1.0.14

func RSAEncrypt(priFile, signingString string) (string, error)

RSAEncrypt 加密

func SignedString

func SignedString(priFile string, v interface{}) (string, error)

SignedString jwt rsa 512 加密

Types

type Claims

type Claims struct {
	Body      interface{}   `json:"body"`
	MapClaims jwt.MapClaims `json:"map_claims"`
}

func (Claims) Valid

func (m Claims) Valid() error

Jump to

Keyboard shortcuts

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