badjwt

package module
v0.0.0-...-241ea51 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 6 Imported by: 0

README

badjwt

A deliberately flawed JWT implementation.

Documentation

Overview

Package badjwt is a deliberately flawed JWT implementation.

Do not copy this code. It is insecure.

Index

Constants

View Source
const Header = `{"alg": "HS256", "typ": "JWT"}`

Header identifies the algorithm used to generate the signature.

Variables

This section is empty.

Functions

func Sign

func Sign(p Payload, key []byte) (string, error)

Sign signs a payload with the given HS256 key.

Types

type Payload

type Payload map[string]any

A Payload is a set of claims.

func Verify

func Verify(token string, key []byte) (Payload, error)

Verify verifies a token using the given HS256 key.

Jump to

Keyboard shortcuts

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