Categorygithub.com/metadiv-io/jwt
modulepackage
1.0.0
Repository: https://github.com/metadiv-io/jwt.git
Documentation: pkg.go.dev

# README

jwt v1

A Go package that provides a simple and secure way to work with JSON Web Tokens (JWT). This package supports both HMAC (secret-based) and RSA (key-based) signing methods.

Installation

go get -u github.com/metadiv-io/jwt

Documentation

jwt v1

# Functions

DecodeUnverified decodes the token without verifying it It returns the claims, or an error if the decoding fails.
DecodeWithKey decodes the token with a public key It returns the claims, or an error if the decoding fails.
DecodeWithSecret decodes the token with a secret It returns the claims, or an error if the decoding fails.
EncodeWithKey encodes the claims with a private key It returns the signed token as a string, or an error if the encoding fails.
EncodeWithSecret encodes the claims with a secret It returns the signed token as a string, or an error if the encoding fails.
NewClaims creates a new Claims instance.

# Constants

who or what the token is intended for.
expiration time, as unix time.
unique identifier for the token.
issued at, as unix time.
who issued the token.
not before, as unix time.
subject of the token.

# Structs

Claims represents the claims in a JWT.