jwttool

package
v0.0.0-...-39e813e Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeString2Key

func DecodeString2Key(pemPri, pemPub string) (priKey *ecdsa.PrivateKey, pubKey *ecdsa.PublicKey)

DecodeString2Key can decode string to pri/pub key

func EncodeKey2String

func EncodeKey2String(pri *ecdsa.PrivateKey, pub *ecdsa.PublicKey) (priKeyStr, pubKeyStr string)

EncodeKey2String can encode pri/pub key to string

func GenerateJWT

func GenerateJWT(info map[string]interface{}) (token jwt.Token)

GenerateJWT is to generate JWT. using ES256. However, this function cannot generate the whole JWT(include head, payload and sign). Only head and payload. Sign part need jwt.Sign to append. After calling jwt.Sign, Sign function return []byte(have processed through base64). Just need to string(what jwt.Sign return).

Types

This section is empty.

Jump to

Keyboard shortcuts

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