token

package
v0.0.0-...-891efdc Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenMsgLen is the length of the msg in bytes
	TokenMsgLen = 8
)

Variables

View Source
var ErrInvalidToken = errors.New("token verification failed")

ErrInvalidToken will be the result of a failed verify

Functions

func Create

func Create(key string) (string, error)

Create creates a token and signs it

func GenerateKey

func GenerateKey() (string, string, error)

GenerateKey creates a new public private key pair and returns it encoded as urlsafe base64

func Verify

func Verify(key, token string) error

Verify verifies a token with a public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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