jwtrsa

package
v0.0.0-...-3ce7580 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRSAJWTToken

func BuildRSAJWTToken(payload []byte, expireAt time.Time, keyID string) (token string, err error)

usualy payload is the serialized protobuf message

func GetPublicKey

func GetPublicKey(keyID string) ([]byte, bool, error)

func ParseRSAJWTToken

func ParseRSAJWTToken(token string, keyID string) (payload []byte, err error)

https://pkg.go.dev/github.com/golang-jwt/jwt

func StorePrivateKey

func StorePrivateKey(keyID string, privateKeyPEM string) (err error)

func StorePublicKey

func StorePublicKey(keyID string, publicKeyPEM string) (err error)

Types

type Provider

type Provider interface {
	BuildRSAJWTToken(payload []byte, expireAt time.Time, rsaKeyID string) (token string, err error)

	ParseRSAJWTToken(token string, keyID string) (payload []byte, err error)

	StorePrivateKey(keyID string, privateKeyPEM string) (err error)

	StorePublicKey(keyID string, publicKeyPEM string) (err error)

	GetPublicKey(keyID string) (key []byte, found bool, err error)
}

Provider to build & sign JWT token using RSA signing method with (with symetric key) It is used for simple email validation

var DefaultHandler Provider = hardcode.New("hello")

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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