...

Package method

import "github.com/MicahParks/keyfunc/v2/examples/custom/method"
Overview
Index

Overview ▾

Constants

CustomAlgHeader is the `alg` JSON attribute's value for the example custom jwt.SigningMethod.

const CustomAlgHeader = "customalg"

type EmptyCustom

EmptyCustom implements the jwt.SigningMethod interface. It will not sign or verify anything.

type EmptyCustom struct{}

func (EmptyCustom) Alg

func (e EmptyCustom) Alg() string

Alg helps implement the jwt.SigningMethod. It returns the `alg` JSON attribute for JWTs signed with this method.

func (EmptyCustom) Sign

func (e EmptyCustom) Sign(_ string, _ interface{}) ([]byte, error)

Sign helps implement the jwt.SigningMethod interface. It does not sign anything.

func (EmptyCustom) Verify

func (e EmptyCustom) Verify(_ string, _ []byte, _ interface{}) error

Verify helps implement the jwt.SigningMethod interface. It does not verify.