jwt

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(key ed25519.PrivateKey, tokenString string, issuer string) (jwt.MapClaims, error)

func ParseEdDSA added in v0.2.0

func ParseEdDSA(key ed25519.PrivateKey, tokenString string, issuer string) (jwt.MapClaims, error)

func ParseHS256 added in v0.2.0

func ParseHS256(secret []byte, tokenString string, issuer string) (jwt.MapClaims, error)

func Sign

func Sign(key ed25519.PrivateKey, claims map[string]any, issuer string, d time.Duration) (string, error)

Sign using EdDSA

func SignEdDSA added in v0.2.0

func SignEdDSA(key ed25519.PrivateKey, claims map[string]any, issuer string, d time.Duration) (string, error)

SignEdDSA (Edwards-curve Digital Signature Algorithm, typically Ed25519) is an excellent, modern choice for JWT signing—arguably safer and more efficient than both HS256 and traditional RSA/ECDSA.

func SignHS256 added in v0.2.0

func SignHS256(secret []byte, claims map[string]any, issuer string, d time.Duration) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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