token

package
v0.0.0-...-2e0bdef Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCredential

type ClientCredential struct {
	Secret []byte
}

func (ClientCredential) CreateSignature

func (r ClientCredential) CreateSignature(payloadInBytes []byte) (string, error)

func (ClientCredential) ValidateSignature

func (r ClientCredential) ValidateSignature(signatureGiven string, payloadInBytes []byte) error

type JWTToken

type JWTToken interface {
	// CreateToken create a token with a content
	CreateToken(content []byte, expired time.Duration) (string, error)

	// VerifyToken verify and return the content
	VerifyToken(tokenString string) ([]byte, error)
}

func NewJWTToken

func NewJWTToken(secretKey string) JWTToken

Jump to

Keyboard shortcuts

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